|
 |
|
ทดสอบส่งเมล์อ่ะครับ และทำการเช็คค่า พาสเวิด ยืนยันก่อนส่งอ่ะครับ |
|
 |
|
|
 |
 |
|
นี่เป็นโค๊ดที่ผมทำอ่ะ แต่มัน error อ่ะครับ
ความต้องการที่จะให้โปรแกรมทำงานคือ
จะทำการส่งเมล์ แล้วก่อนส่งให้ทำการเช็ค รูปภาพที่ได้ทำการ random ขึ้นมาอ่ะ
หากเช็กว่าตรงก็ทำการส่ง ถ้าไม่ตรงให้กลับมายืนยัน โค๊ดใหม่นะคับ
ใครก็ช่วยผมด้วย
<html>
<body bgcolor="#FFFFFF">
<p>ทดสอบการส่งเมลล์ครับ</p>
<form name="form1" method="post" action="sendmail.php">
อีเมลล์ผู้รับ
<input type="text" name="To">
<br>
ชื่อเรื่อง หัวข้อ
<input type="text" name="Subject">
<br>
ข้อความ
<textarea name="Massage" rows="5" cols="50"></textarea>
<br>
ผู้ส่ง
<input type="text" name="From">
<br>
<?php
// create a 100*30 image
$im = imagecreate(79, 25);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 000);
$textcolor = imagecolorallocate($im, 233, 14, 91);
function random_password($len)
{
srand((double)microtime()*10000000);
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
$ret_str = "";
$num = strlen($chars);
for($i = 0; $i < $len; $i++)
{
$ret_str.= $chars[rand()%$num];
$ret_str.="";
}
return $ret_str;
}
// write the string at the top left
imagestring($im, 5, 10,5, random_password(7), $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>
<input type="submit" name="Submit" value="ส่งเมลล์">
</form>
</body>
</html>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-08-28 13:29:14 |
By :
ตัวเล็ก |
View :
1146 |
Reply :
0 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 05
|