<?php // smarty.php$path = $_SERVER['DOCUMENT_ROOT'];require "$path/Smarty/Smarty.class.php";$smarty = new Smarty();$smarty->template_dir = "$path/temp/smarty/templates";$smarty->compile_dir = "$path/temp/smarty/templates_c";$smarty->cache_dir = &quo Read More
posted @ 2013-02-12 22:59 findumars Views(2369) Comments(0) Diggs(0) Edit
<?php // formtest2.phpif (isset($_POST['name'])) $name = $_POST['name'];else $name = "(Not entered)";echo <<<_END<html> <head> <title>Form Test</title> </head> <body> Your name is: $name<br /> <form method="post& Read More
posted @ 2013-02-12 22:50 findumars Views(1019) Comments(0) Diggs(0) Edit
第十章<?php // login.php$db_hostname = 'localhost';$db_database = 'publications';$db_username = 'username';$db_password = 'password';?><?phprequire_once 'login.php';$db_server = mysql_connect($db_hostname, $db_username, $db_password);if (!$db_server) die Read More
posted @ 2013-02-12 22:36 findumars Views(291) Comments(0) Diggs(0) Edit
PRINTF("THE RESULT IS $%15F\N", 123.42 / 12);PRINTF("THE RESULT IS $%15.2F\N", 123.42 / 12);$h = 'House';printf("[%s]\n", $h); // Standard string outputprintf("[%10s]\n", $h); // Right justify with spacesprintf("[%-10s]\n", $h); // Left justi Read More
posted @ 2013-02-09 01:15 findumars Views(3396) Comments(0) Diggs(0) Edit
<?php$paper[] = "Copier";$paper[] = "Inkjet";$paper[0] = "Copier";$paper[1] = "Inkjet";print_r($paper);for ($j = 0 ; $j < 4 ; ++$j) echo "$j: $paper[$j]<br>";$paper['copier'] = "Copier & Multipurpose";$paper['ink Read More
posted @ 2013-02-09 00:41 findumars Views(327) Comments(0) Diggs(0) Edit