hidden variable not working correctly
Posted: Sat Oct 25, 2008 5:51 pm
new programmer-
I cannot get a variable to pass between these php pages?
/index.php?content=showaccount&id=97055512120001
I want the id to pass to the next page
page is called 'enteraccount2.inc.php'
I want the id to pass to the next page
updateaccount.inc.php
I keep getting the message "there was a problem posting your updates "
where did I go wrong?
I cannot get a variable to pass between these php pages?
/index.php?content=showaccount&id=97055512120001
I want the id to pass to the next page
page is called 'enteraccount2.inc.php'
Code: Select all
<form action=index.php method=post target="_self">
<input type="hidden" name="custid" value="<? echo $_GET['id']; ?>">
<h2>Enter account information here!!</h2><br>
<table width="300" border="0">
<tr>
</tr>
<tr>
<td>email </td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td>password</td>
<td><input type="text" name="password"></td>
</tr>
<tr>
<td><input type="submit" value="Submit">
<input type="hidden" name="content" value="updateaccount"></td>
</form>
updateaccount.inc.php
Code: Select all
<?php
$custid = $_GET['id'];
$email = $_GET['email'];
$password = $_GET['password'];
{
$query = "INSERT INTO account (custid, email, password)" .
" VALUES ('$custid', '$email', '$password')";
$result = mysql_query($query);
if ($result)
echo "<h2>Updates posted to account</h2>\n";
else
echo "<h2>Sorry, there was a problem posting your updates</h2>\n";
echo "<a href=\"index.php?content=showaccount&id=$custid\">Return to show account</a>\n";
}
?>
where did I go wrong?