here is my code. it grabs id number from url then post data to mysql. everything is working fine.. the is also updating by this codes..
but the problem is after clicking the change button it goes to a blank page.
check out
http://www.platformsociety.org/update3.php/?id=2
is it possible that after clicking the button CHANGE . it wil sho that " the data sucessfully saved"Code:<?php $hostname = "local"; $username = "lash"; $password = "lash"; $db = mysql_connect($hostname, $username, $password) or die ("not able to connected to mysql"); // connect to database mysql_select_db("lash")or die("Connection Failed"); $id = $_GET['id']; if(isset($_POST['id'])) { $sql="UPDATE page SET dtl='".$_POST['content']."' WHERE id = ".$_POST['id']; mysql_query($sql) or die(mysql_error()); } $result = mysql_query("select * from page where id = $id"); $row = mysql_fetch_assoc($result); mysql_close($db); ?> <html> <head></head> <body> <form name="change_content" method="POST" action="update3.php"> <input type="hidden" name="id" value="<?php echo $row["id"]; ?>"> <textarea name="content"><?php echo $row["dtl"]; ?></textarea> <input type="submit" value="change"> </form> </body> </html>



Reply With Quote


Bookmarks