Smarty basics

Original php file code:Include_once ("./comm/Smarty. class. php"); // contains the smarty class fileDefine ("NUM", 5); // defines the number of news entries displayed each time.$ Smarty = new Smarty (); // Create a smarty instance object $ smarty$

Assignment of smarty Templates

With smarty, how do I use global variables such as $ _ SESSION $ _ COOKIE in the template file? The format.

Smarty with foreach

Yesterday I wrote a simplest smarty file. Today I will learn more. Now I will share my learning experience. First of all, let's look at the one. tpl file.This is my the smarty! Group_id: Group_name: Group_time: Group_auth: No infomationForeach is

The Smarty breakdown shows that some of them can be simpler.

Include "config/config. php ";Include "config/dbclass. php ";Include "include/FreeDayCodeChange. php ";$ My = new mydb ();$ My-> c_all ($ db_host, $ db_user, $ db_psw, $ db_table );// Require ("include/sess. php ");$ My = new mydb ();$ My-> c_all ($

Recursively process submitted data

/*** Recursive processing of submitted data** @ Param string | array $ data submit data* @ Return string | array*/Define ("PHP_MAGIC_GPC", get_magic_quotes_gpc ());Function rAddSlashes (& $ data){// The previously defined constant is used hereIf (!

Simple pagination of smarty

Simple pagination of smartyThe following is the smarty code in the template. You can simply use smarty to replace the relevant variables. It is very simple, but you need to input the page parameter in the php code. I think this is quite simple. I

Chinese character truncation methods supported by UTF-8 and GB2312

Function cut_str ($ string, $ sublen, $ start = 0, $ code = 'utf-8 '){If ($ code = 'utf-8 '){$ Pa = "/[x01-x7f] | [xc2-xdf] [x80-xbf] | xe0 [xa0-xbf] [x80-xbf] | [xe1-xef] [x80-xbf] [x80-xbf] | xf0 [x90-xbf] [x80-xbf]] [x80-xbf] | [xf1-xf7] [x80-xbf]

Window. createPropup

Tip: you can modify some code before running Tip: you can modify some code before running

Floating advertisement

Tip: you can modify some code before running Tip: you can modify some code before running

Improve Web page performance

Click Add to delete table rows

Tip: you can modify some code before running Untitled Document Clear Llinzzi Huanhuan Tom.com super long Copy selected Delete selected Select all A1 A2 A3

Imitating QQ menus

Tip: you can modify some code before running RankingsKoma(The weather is good today !)Anna(Start in the next year !!)Wind(Headache)Ainemo(There is no way to go back and forth .)Nick(I can't see the sorrow of Lao Tzu even if I have been a normal user)

Scroll with linked image

Tip: you can modify some code before running Tip: you can modify some code before running

How to shield web pages from viewing source files

Tip: you can modify some code before running First, you should shield the Internet Explorer toolbar-view-source code function, that is, the page uses the framework structure. if your page does not use a frame structure and does not need a frame

Table horizontal layout method

Tip: you can modify some code before running 1. Add align = left to the label table 1 table 2 table 3 table 4 2. Add display: inline to the table style; table 1 table 2 table 3 table 4   Tip: you can modify

* Table * related questions

Tip: you can modify some code before running Create a border for a no1 or 1 pixel tableThere are many methods, and the effects of different methods are not exactly the same.1. Use cellspacing and background color 2. Use CSS 3. Use a 1-pixel

Add an image to the top of the progress bar

Tip: you can modify some code before running http://bbs./images/avatars/07.gif"> Tip: you can modify some code before running

Dynamic table editing

Tip: you can modify some code before running Table Editor Single click to select a cell, alt-click to select a row Cell 1, 1 Cell 1, 2 Cell 1, 3 Cell 2, 1 Cell 2, 2 Cell 2, 3 Cell 3, 1 Cell 3, 2 Cell 3, 3 Tip: you

Flashing neon lights

Tip: you can modify some code before running Script Description:Step 1: Add the following code to the area:  Step 2: change the content in Tip: you can modify some code before running

RGB color conversion

Tip: you can modify some code before running Script Description:Step 1: Add the following code to the areaStep 2: Add the following code to the area enter the RGB color value (0 to 255) Red: Green: Blue: Hex code: Tip: you can modify some

Total Pages: 64722 1 .... 45319 45320 45321 45322 45323 .... 64722 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.