Home Web Design Tutorials cms seo flash inspiration Graphics graphic design photoshop vectors icons typography texture Programming html css javascript php wordpress joomla Tutorials Free Other dissenting photos link on sex & web www resources website promotion archive
An experienced web developer with years of experience in back-end and front-end veste coding. Recently, the company's IT project manager Sense. Most proud of the project veste SliceMachine that helps in cutting design veste and conversion of the website.
Today we start with the basics of the PHP language. veste I do not want to predict what level of prior knowledge of programming you have, and I can guarantee that you will be able to follow this series of tutorials even if you have never encountered programming.
Unlike various CGI scripts, PHP language, you can include in the HTML code. PHP is a "server-side" language which would mean that you run on the server side, a result of its execution is, most often, veste izgenerirani HTML code.
1 2 3 4 5 6 7 8 9 10 11 12 13 <! DOCTYPE html PUBLIC "- // W3C // DTD XHTML 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns = "http: / /www.w3.org/1999/xhtml "> <head> <meta http - equiv =" Content-Type "content =" text / html; charset = utf-8 "/> <title> Example 1 </ title> </ head> <body> veste <p> Who are you? </ P> <? Php echo "<p> I generated HTML code with the help of the PHP language." ; ?> </ Body> </ html>
Ah yes, to start the sample code, copy / paste the code in Notepad ++ (or who already have a text editor). Because security is at the opening PHP tag here on tutorial is a space in the <? Php and remove it. Create a folder in the folder www tutorial located where you installed veste WAMP (eg. C: \ wamp \ www \ tutorial) and it then save your file with the code named primjer1.php. Then go into your favorite browser and type http: //localhost/tutorial/primjer.php and that's it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 <! DOCTYPE html PUBLIC "- // W3C // DTD XHTML 1.0 Transitional veste // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns = "http: / /www.w3.org/1999/xhtml veste "> <head> <meta http - equiv =" Content-Type "content =" veste text / html; charset = utf-8 "/> <title> Example 2 </ title> veste </ head> <body> <p> Who are you? </ P> <? Php // define variables $ name = 'HTML'; $ Language = 'PHP'; echo "<p> I have generated $ name in with the help of $ tongue language." ; // Same result is obtained in this way echo "<p> I have generated". $ Name. "Code to help". $ Language. "Language. </ P>"; ?> </ Body> </ html> If you look at the above code in the browser, you will get the same print as before. But the difference is that we are in this case used the variable $ name and $ language in which smmo saved values. veste Each variable in PHP language must begin with a $ (dollar) and all the variables "case-sensitive" means that the $ name and $ NAME are not the same variable. Note that in PHPU do not have to declare the type of the variable: <pre lang = "php" line = "1"> <? Php $ name = 'Zvonko'; veste // Variable of type String year = $ 5; // Variable of type integer $ a = true; // Variable of type boolean?>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 <! DOCTYPE veste html PUBLIC "- // W3C // DTD XHTML 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns = "http: / /www.w3.org/1999/xhtml "> <head> <meta http - equiv =" Content-Type "content =" text / html; charset = utf-8 "/> <title> Example 3 </ title> </ head> <body> <? php // quantity of $ quantity = 500; // Original price and the current price of $ origPrice = 100; CurrPrice = $ 25; // Lets calculate the difference in price $ diffPrice = $ currPrice - $ origPrice; // Lets calculate how much this percentage diffPricePercent = $ (($ currPrice - $ origPrice) * 100) / $ origPrice; ?> <Table border veste = "1" cellspacing = "5" cellspacing = "0"> <tr> veste <td> Quantity </ td> <td> Price </ td> <td> Current price </ td> <td > change </ td> <td> Price change in percent </ td> </ tr> <tr> <td> <? php echo $ quantity; ?> </ Td> <td> <? Php echo $ origPrice; ?> </ Td> <
No comments:
Post a Comment