|
 |
|
อยากสอบถามเกี่บวกับ javascript 1. อยากสอบถามว่าถ้าเราใช้ javascript:history.back() |
|
 |
|
|
 |
 |
|
ตอบ1 ปกติใช้ javascript:history.back() ข้อมูลก็ยังคงอยู่นิครับเว้น input:password จะถูกลบเป็นมาตรฐานมันอยู่แล้ว ลองเช็คโค้ดใหม่ ให้ตย.
register.html(PHP)
<form method="post" action="next.html">
username:<input type="text" ><br/>
password:<input type="password"><br/>
email:<input type="text"><br/>
<input type="submit" value="register">
</form>
next.html(PHP)
ยืนยันอีกครับ</br>
<a href ="javascript:history.back() ">ย้อนกลับ</a><br/>
<a href="confrim.php">ตกลง</a>
ตอบ2 (ขอ edit ข้อความละกัน) โค้ดเก่าลบทิ้งไปแล้วมันไม่ support ie อันนี้โค้ดใหม่วิธีทำ refresh verify
Code (PHP)
<script>
function refresh(){
document.getElementById('imgs').src= "imageVerify.php?"+ Math.random();;
}
</script>
<FORM METHOD=POST ACTION="processor.php">
Code: <INPUT TYPE=TEXT id="code"> <IMG id="imgs" SRC="imageVerify.php"><BR>
<input type="button" value="refresh" onclick="refresh()">
imageVerify.php (PHP)
<?php
session_start();
$text ="abdefghijkmnpqrtuyABCDEFGHIJKLMNPQRTUYZ123456789";
$im = imagecreatetruecolor(100, 30);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor= imagecolorallocate($im, 0, 0, 0);
// Make the background red
imagefilledrectangle($im, 0, 0, 299, 99, $bg);
// Path to our ttf font file
$font_file = 'TYPEWRITERFROMHELL.ttf';
$rand =substr(str_shuffle($text),0,6);
$_SESSION['verify_code'] =$rand;
// Draw the text 'PHP Manual' using font size 13
imagefttext($im, 15, 0,5, 20, $textcolor, $font_file,$rand);
imagefttext($im, 15, 0,6, 21, $textcolor, $font_file,$rand);
// Output image to the browser
header('Content-Type: image/jpg');
imagepng($im);
imagedestroy($im);
exit();
?>
สั้นกว่าโค้ดเก่าเยอะ :>
|
 |
 |
 |
 |
Date :
2009-11-14 13:37:03 |
By :
xbeginner01 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ ทำได้แล้วครับ
ดัดแปลงนิดหน่อย
|
 |
 |
 |
 |
Date :
2009-11-16 11:37:16 |
By :
Mal2s |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|