Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 16 to 20 of 20
09-26-2012, 03:13 AM #16
You are doing this:
$id = $_POST['id'];
Easiest way to fix it:
<input type="hidden" name="id" value="<?php echo $row['id']; ?>" />
Last edited by Old Pedant; 09-26-2012 at 03:17 AM.Be yourself. No one else is as qualified.
09-26-2012, 03:17 AM #17
Another way to fix it:
Replace this first <td>:
<td><? echo $row['id']; ?></td>
<td><input name="id" style="border: none;" readonly="readonly" value="<? echo $row['id']; ?>" /></td>Be yourself. No one else is as qualified.
Users who have thanked Old Pedant for this post:
09-26-2012, 07:58 AM #18
Originally Posted by Old Pedant
- Join Date
- Mar 2007
- Thanked 2,249 Times in 2,236 Posts
If it's a page accessible to more than one user of your site, you have to make sure that the user who submits the form has the right permission to update the records referred by that id.The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
09-26-2012, 02:08 PM #19
- Join Date
- Sep 2012
- Thanked 0 Times in 0 Posts
The issue is now resolved. Thanks to another forum I found out that you cannot pass values from HTML to PHP without other PHP programmers wanting to tar and feather you. Once I put everything into php it worked fine. Thanks for all the help! Which is basically what you just said Old Pedant. Thanks for your help!
09-26-2012, 09:30 PM #20you cannot pass values from HTML to PHP without other PHP programmers wanting to tar and feather you.
The HTML that submits the <form> can be written in plain HTML, in PHP, in ASP, in JSP, or in any other way. The browser has no idea where the HTML came from, so it will render it the same and process the <form> the same, no matter the source. And so long as the action= of the <form> points to a PHP page, then PHP can process it, no matter the source.
The only oddity in PHP (not found in any other server-side system) is that if you have multiple fields with the same name then the name must end in  to indicate a possible array of values to PHP. Big deal. I can code that in Notepad and HTML just as easily as I could code it in PHP.
Maybe you shouldn't pay too much attention to those other forums.Be yourself. No one else is as qualified.