why wont this variable pass?
Posted: Sat Oct 25, 2008 11:33 am
For future note: please post code within tags, as I have done below for you. It's easy to do, just use the Code button when you are composing your message.
new programmer:
I want to pass the variable "id" that is in this url
http://localhost/Buzztown/index.php?con ... 5512120001
HERE IS THE HTML FORM (that is under this URL)
HERE IS THE PHP PAGE
I keep getting echo Sorry, there was a problem posting your updates
It's beacause the ID is not being passed to this page....
where did I go wrong?
new programmer:
I want to pass the variable "id" that is in this url
http://localhost/Buzztown/index.php?con ... 5512120001
HERE IS THE HTML FORM (that is under this URL)
Code: Select all
<form action=index.php method=post>
<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="custid" value="?php echo htmlspecialchars('$id'); ?"></td>
<input type="hidden" name="content" value="updateaccount"></td>
Code: Select all
<?php
echo "The Value of action is:".$_POST['$id'];
$accountid = $_POST['custid'];
$email = $_POST['email'];
$password = $_POST['password'];
{
$query = "INSERT INTO account (custid, email, password)" .
" VALUES ('$accountid', '$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";
}
?>
It's beacause the ID is not being passed to this page....
where did I go wrong?