write-reply.php shows a certain message(here is the msg which id=4) you wanna reply,and give a textarea for you to write reply content.
here is writereply.php
reply.php writes the related data into the databse
reply.php:
Write "something" in the textarea of REPLY1 and then click text link "REPLY1", the reply.php shows: 4success!
Write "something" in the textarea of REPLY2 and then click submit button "REPLY1", the reply.php shows: something
How to AT THE SAME TIME transfer "reply" and "id" to reply.php so that the codes between /* */ of reply.php can work?
here is writereply.php
| Code: |
| <html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>reply</title> </head> <body> <p align="center">MY GUESTBOOK</p> <?php $id=4; //this page reply msg id=4 echo"<textarea class='samllArea' cols='38' name='reply' rows='4'></textarea>"; echo"<a href='reply.php?id=$id'>REPLY1</a>"; echo"<FORM METHOD='POST' ACTION='reply.php'><textarea class='samllArea' cols='38' name='reply' rows='4'></textarea><INPUT TYPE='submit' NAME='' alue="REPLY2"></FORM>"; ?> </body> </html> |
reply.php writes the related data into the databse
reply.php:
| Code: |
| <?php
$dbhost="localhost"; // $dbname="mydata"; // $dbusername="root"; // $dbpassword=""; // $id=$_GET[id]; $reply=$_POST[reply]; echo $reply; echo $id; $db=mysql_connect($dbhost,$dbusername,$dbpassword); if($id){echo"success!<br>";} /* mysql_select_db($dbname,$db); $sql="UPDATE guest SET retime=NOW() WHERE id='$id'"; $result=mysql_query($sql,$db); //reply time $sql="UPDATE guest SET reply='$reply' WHERE id='$id'"; $result=mysql_query($sql,$db); //reply words echo"<center>"; echo"reply succeeds!<a href=show.php>BACK</a></b>"; */ ?> |
Write "something" in the textarea of REPLY1 and then click text link "REPLY1", the reply.php shows: 4success!
Write "something" in the textarea of REPLY2 and then click submit button "REPLY1", the reply.php shows: something
How to AT THE SAME TIME transfer "reply" and "id" to reply.php so that the codes between /* */ of reply.php can work?
