PHP) สำหรับ Dynamic Websiteพีเอชพี (PHP) สำหรับ Dynamic Websiteปรับปรุง : 2. Send mail by HTML format. POST{"mfrom"})) $_POST{"mfrom"} = "". POST{"mto"})) $_POST{"mto"} = "". POST{"msubj"})) $_POST{"msubj"} = "". POST{"message"})) $_POST{"message"} = "".
POST{"redirect"})) $_POST{"redirect"} = "". GET{"mfrom"})) $_GET{"mfrom"} = "". GET{"mto"})) $_GET{"mto"} = "". GET{"msubj"})) $_GET{"msubj"} = "". GET{"message"})) $_GET{"message"} = "". GET{"redirect"})) $_GET{"redirect"} = "".
POST{"mfrom"} . $_GET{"mfrom"}. POST{"mto"} . $_GET{"mto"}. POST{"msubj"} . $_GET{"msubj"}. POST{"message"} . GET{"message"}. $redirect = $_POST{"redirect"} . GET{"redirect"}. if (empty($redirect)) { $redirect = "http: //www.
Provides basic to advanced PHP functions. Users can also learn how to integrate PHP with other languages such as MYSQL, AJAX, and XML. This how you make an HTML5 <time> tag correctly <?php echo '<time datetime=''. date ('c'). ''>'. date ('Y - m - d'). '</time>';?> in the 'datetime' attribute you should put a machine-readable value which represent time, the.
From : < input name=mfrom value='$mfrom' size=3. To : < input name=mto value='$mto' size=3. Subject : < input name=msubj value='$msubj' size=5. Messages: < br> < textarea name=message rows=1. Send mail'> ". Subject _ ".$msubj. From: $mfrom\r\n".
Reply- To: $mfrom\r\n". MIME- Version: 1. Content- Type: text/html; charset=windows- 8. Content- Transfer- Encoding: 7bit\r\n". X- Priority: 1\r\n".
X- Mailer: PHP/" . From: $mfrom\n. X- Mailer: PHP/" . Refresh content='5. URL=$redirect'> ". From : $mfrom \n". To : $mto \n". echo "Subject : $msubj \n".
Message : < ul> < font color=gray> " . Your message sending : < b> Completely< /b> \n". Script developer : webmaster@thaiall. Write image in JPEG format by GD JPEG supporting. GD GIF but support GD JPEG. Content- type: image/jpeg").
Image = Image. Create($imagesize, $imagesize). Image. Color. Allocate($my. Image, 2. 55, 2. 55, 2. Image. Color. Allocate($my. Image, 2. 55, 0, 0). Image. Fill($my. Image, 0, 0, $red). Imageinterlace($my.
Image, 1). Imagearc($my. Image, 4. 0, 3. 0, 2. Image. Line($my. Image, 5, 5, 7. Imagestring($my. Image, 3, 5, 4. This กขค."), $white). Imagejpeg($my. Image).
Imagedestroy($my. Image). ######## securecode. FILE=file ("topic. FILE). # $key=ord(substr(crypt($key,$key),6,1)) * 1.
Content- type: image/jpeg"). Image = Image. Create(8. Image. Color. Allocate($my. Image, 2. 55, 2. 55, 2. Image. Color. Allocate($my.
Create dynamic sites with PHP & MySQL Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Table of Contents If you're viewing this document online, you can click any of the topics below to link. CMS + LMS txt2gift.php ช่วยให้อาจารย์ที่มีข้อสอบนำ ข้อสอบจาก excel หรือ text file ไป import เข้า moodle 1.5 โดยใช้.
Image, 2. 55, 0, 0). Image. Fill($my. Image, 0, 0, $red).
Imagestring($my. Image, 5, 5, 5, "$key", $white). Imagejpeg($my. Image).
Imagedestroy($my. Image). : : Listing of thumb nail and click to enlarge. GET["p"])) $_GET["p"] = 1. Ex. Monday, 2. 7th October, 2. Last modified " .
S F, Y @ h: ia", $last_modified). GET["p"] * $pp. print "< table width=1. GET['height'])) $h = " height=".$_GET['height'].
GET['width'])) $w = " width=".$_GET['width']. GET['height']) & & ! GET['width'])) $w = " height=1.
GET['bgcolor'])) $b = " bgcolor=".$_GET['bgcolor']. Open Photo Dir< br> Type . GET['type'])) echo "< ol> ". GET['type'])) {. echo "< li> < a href=$list> $list< /a> ". GET['type'])) echo "< /ol> ". F: \IT\doc\burin\.').
Y m d G i", filemtime("./doc/burin/$list"))] = $list. Array database of course description. Course description database< /title> < /head>. CSV< /a> ]. ACCT 1. 00'}="การบัญชีทั่วไป~3(3- 0)~~ศึกษา..". ACCT 2. 01'}="หลักการบัญชี 1~3(3- 0)~~ศึกษาเกี่ยว..".
ACCT 2. 02'}="หลักการบัญชี 2~3(3- 0)~หลักการบัญชี 1 (ACCT 2. GET['codes'])) { $c = $_GET['codes']; }. POST['codes'])) { $c = $_POST['codes']; }.
Code เพิ่มเติมเกี่ยวกับอาร์เรย์. Key: $key; Value: $value< br> ". Key: $key; Value: $value< br> ". Security by word in image putting. POST['keept'] % 5. POST['u'] == "a" & & $_POST['p'] == "b") & & (.
POST['w'] == "abc") ||. POST['w'] == "def") ||.
POST['w'] == "oho") ||. POST['w'] == "love") ||.
POST['w'] == "wow") )). Word in picture : < input name=w> < br>.
User : < input name=u value="a"> < br>. Password : < input name=p value="b"> < br>. Check password">.
PHP+MDB in Windows. Source Code : (empl.
KB = empl : emplid as double,emplname as text,emplsalary as double). Connection method of PHP+MDB in Windows< br>. DSNLess& action=List> DSNLess+List< /a> |. DSNLess& action=Add.
DSNLess+Add. 1< /a> |. DSNLess& action=Delete. DSNLess+Delete. 99< /a> < br>. Odbc. DSN& action=List> Odbc.
DNS+List< /a> |. Odbc. DSN& action=Add. Odbc. DNS+Add. 1< /a> |. Odbc. DSN& action=Delete. Odbc. DNS+Delete.
GET{'action'})) {. GET["connect"] = "DSNLess". GET["action"] = "List". GET["connect"] = $_GET{'connect'}. GET["action"] = $_GET{'action'}. DNSLess connection method.
GET["connect"] == "DSNLess" ) {. ODBC Data Sources. COM("ADODB. Connection"). DRIVER={Microsoft Access Driver (*. DBQ=". realpath("empl. GET["action"] == "List") {. Fields(0). $rs_fld.
Fields(1). while (!$rs- > EOF) {. Move. Next(). $rs- > Close(). GET["action"] == "Add. Add. 1 : complete". GET["action"] == "Delete. Delete. 99 : complete (all where emplid=9.
Close(). // Odbc. DNS connection method.
Open Data. Base connectivity & Data source name). ODBC driver ในเครื่องนะครับ ปกติเครื่องที่ลง office น่าจะมี.
Control panel, ODBC Data Sources, System DSN, Add, Access, empldsn, select, .. GET["connect"] == "Odbc. DSN" ) {. $cnx = odbc_connect('empldsn','','').
GET["action"] == "List") {. SQL_Exec_String = "select * from empl".
SQL_Exec_String ). GET["action"] == "Add. SQL_Exec_String = "insert into empl(emplid,emplname)values(9. SQL_Exec_String ). Add. 1 : complete". GET["action"] == "Delete.
SQL_Exec_String = "delete from empl where emplid =9. SQL_Exec_String ). Delete. 99 : complete (all where emplid=9. Open File From Internet (ดูดเว็บอื่นมาใช้งานเป็นเว็บเพจของเรา). Server ไม่ยอมให้ใช้ file() ดูดข้อมูลจากเว็บเพจนอกเครื่อง (Using remote files) เช่น thaiall.
Commnet : manager. Response Time ต่ำ ไม่เหมาะที่จะดูด. Home/default. html"). Directory และเปลี่ยน Link ของ Google.
Directory ของ google (ปรับปรุง 2. GET['url'])) {. echo '< meta http- equiv="content- type" content="text/html; charset=UTF- 8"> '. My Directory< /b> \n". Top/World/Thai/","? Top/World/Thai/" .
GET['url']) . "> < /frameset> ". POST['url'])) {. $chk. POST['url']). for($i=0; $i< count($r); $i++) {. UTF- 8"> '. echo "< base href='$base'> ". FILES["uploadfile"]["name"])) {. FILES["uploadfile"]["tmp_name"],"./".$_FILES["uploadfile"]["name"])). FILES["uploadfile.
POST{'x'}."< br> ". Upload : " . $_FILES["uploadfile$i"]["name"].
FILES["uploadfile$i"]["tmp_name"],"./".$_FILES["uploadfile$i"]["name"])). POST["new"])). if (copy($_FILES["uploadfile"]["tmp_name"],"./".$_POST["new"])). FILES["uploadfile"]) & & $_POST["pass"] == "thailand") {. FILES["uploadfile"]["tmp_name"],"./banner. Location: http: //www. Password : < input name="pass">.
File in jpg format : < input type="file" name="uploadfile">. GET["uname"])) {. GET['uname'],time() + 3. COOKIE['uname']; ?>. PHP/User- Authentication/1. Linux. # session_save_path("f: /2.
SESSION['count'])) {. SESSION['count'] = 1. SESSION['count']++. Hello visitor, you have seen this page < ?=$_SESSION['count']; ?> times. Security. : : ถ้าใช้ session ไม่ได้ ก็ให้กำหนด session_save_path ตาม $_ENV["DOCUMENT_ROOT"]. Hrs คือ ac, be, d). Source Code : http: //www.
POST['regist'])) {. Timetabling'> ". POST['regist']). foreach($student as $one) {. Source Code : http: //www.
GET{'b. 1'})) {. $sample = "barchart. Can test at http: //www. Content- type: image/png"). Image. Color. Allocate($im, 2.
Image. Color. Allocate($im, 2. Image. Color. Allocate($im, 2.
Image. Color. Allocate($im, 0, 0, 0). GET{"b".$i})) {. imagerectangle($im,$bw * $i,$height - $_GET{"b".$i},$bw * $i + 8,$height - 2. GET{"b".$i}, $yellow).
Content- type: image/png"). GET{"string"})) $string = "? GET{"string"}. $im = @imagecreate ($width,$height). Image. Color. Allocate($im, 2. Image. Color. Allocate($im, 2.
Content- Type: image/gif"). GET["f"]) & & file_exists($_GET["f"].". GET["f"].". jpg"; }. Content- Type: image/png"). Content- Length: " .
GET["file"])) {. $f = "ทดสอบ. GET["file"]. header('Content- type: application/pdf'). Content- Disposition: inline; filename="foo. Transparent< ? Content- Type: image/gif'). Content- Type: image/png"). GET["name"]) & & file_exists($_GET["name"] .
My. Server. 70","sa",""). Northwind",$msconnect). Online User Counter (no mysql). SERVER["REMOTE_ADDR"].",".
SERVER["REMOTE_ADDR"]) {. SERVER["REMOTE_ADDR"].",". Bad Word Blockinging (หาคำที่ไม่สุภาพ แล้วเปลี่ยน). POST["word"] = str_replace($bad[$b],".",$_POST["word"]). POST["word"]. < /body> ต.ย.
Redirection Header (จาก www. GET['codes'])). header("Location: http: //yn. GET['codes']). header("Location: http: //yn.
Encode and Decode. URL แก้ปัญหา Internal Server Error ในบางกรณีได้. POST["ch"])) $a = "< a title=test> ทดสอบ/aaa< /a> // \\ // \\". POST["ch"]. // Normal Output. Output: ทดสอบ/aaa // \ // \. Un- quote string quoted with addslashes().
Output: ทดสอบ/aaa // //. Quote string with slashes. Output: ทดสอบ/aaa // \\ // \\. URL- encodes string. Output: %3. Ca+title%3.
Dtest%3. E%B7%B4%CA%CD%BA%2. Faaa%3. C%2. Fa%3. E+%2. F%2. F+%5. C+%2. F%2. F+%5. C. // Decodes URL- encoded string. Output: ทดสอบ/aaa // \ // \. Convert special characters to HTML entities.
Output: < a title=test> ทดสอบ/aaa< /a> // \ // \. Convert all applicable characters to HTML entities. Output: < a title=test> ?????/aaa< /a> // \ // \. Encodes data with MIME base.
Output: PGEgd. Gl. GU9d. GVzd. D6. 3t. Mr. Nui. 9h. YWE8. L2. E+IC8v. IFwg. Ly. 8g. XA==. // Decodes data encoded with MIME base. Output: ทดสอบ/aaa // \ // \. One- way string encryption (hashing) (ผลไม่ซ้ำกัน).
Output: $1$RL. GJ.$Hzb. Dn. URKr. 6i. BOL1txhwk.
EX. if (crypt($user_input, $passwd) == $passwd) echo "OK". EX. if (crypt($_GET["p"],"$1$0. Hv/") == "$1$0. 1.
Hv/") { }. < form action="" method=post> < input name=ch> < input type=submit> < /form>. REQUEST["t"])) {.
REQUEST["t"]. for($i = 0; $i< strlen($txt); $i++) {echo sprintf("%0. REQUEST["t"])) echo $_REQUEST["t"]; else echo "กขค". Ascii กลับเป็นภาษาไทย.
Each _SESSION, _SERVER, _ENV. Session หรือตัวแปร Server. SESSION["a"] = 5. SESSION as $k=> $v) {. SESSION["$k"]. foreach ($_SERVER as $k=> $v) {.