02 2013 档案

摘要:<?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 阅读全文
posted @ 2013-02-12 22:59 findumars 阅读(2379) 评论(0) 推荐(0) 编辑
摘要:<?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& 阅读全文
posted @ 2013-02-12 22:50 findumars 阅读(1022) 评论(0) 推荐(0) 编辑
摘要:第十章<?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 阅读全文
posted @ 2013-02-12 22:36 findumars 阅读(295) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2013-02-09 01:15 findumars 阅读(3404) 评论(0) 推荐(0) 编辑
摘要:<?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 阅读全文
posted @ 2013-02-09 00:41 findumars 阅读(331) 评论(0) 推荐(0) 编辑
摘要:<?php$names = fix_names("WILLIAM", "henry", "gatES");echo $names[0] . " " . $names[1] . " " . $names[2];function fix_names($n1, $n2, $n3){ $n1 = ucfirst(strtolower($n1)); $n2 = ucfirst(strtolower($n2)); $n3 = ucfirst(strtolower($n3)); return array 阅读全文
posted @ 2013-02-09 00:26 findumars 阅读(1814) 评论(0) 推荐(0) 编辑
摘要:<?phpinclude("library.php");include_once("library.php");require_once("library.php");echo "Hello world";$username = "Fred Smith";echo $username;echo str_repeat("Hip ", 2); // Repeat stringecho strtoupper("hooray!"); // String to 阅读全文
posted @ 2013-02-09 00:15 findumars 阅读(486) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示