when submit is pressed should update then go to index page. but just getting blank page but it is updating
cheers
Doug
<body>
<?
$dbh=mysql_connect("localhost", "xxxx", "xxxxx") or die('I cannot connect to database because: ' .mysql_error()) ;
mysql_select_db("xxxxx");
if($_POST['Submit']){
// Get parameters from form.
$id=$_POST['id'];
$item=$_POST['item'];
mysql_query("update products set item='$item' where id='$id'");
header('location: index.php');
exit;
}
$id=$_GET['id'];
$result=mysql_query("select * from products where id='$id'");
$row=mysql_fetch_assoc($result);
mysql_close();
?>
<!-- END OF PHP CODES AND START HTML TAGS -->
<html>
<body>
<!-- set this form to POST method and target this form to itself ($PHP_SELF;)-->
<form id="form1" name="form1" method="post" action="<? echo $PHP_SELF; ?>">
<input type="hidden" name="id" value="<?php echo $row['id']; ?>" />
<p>Item :
<input name="item" type="text"size="100" id="item" value="<? echo $row['item']; ?>"/>
<br />
<p> <input type="submit" name="Submit" value="Submit" /> </p>
</form>
</body>
</html>