passing a $_POST variable
| From: | dpgirago at mdanderson dot org | Date: | Fri, 16 Jan 2004 15:44:21 +0000 |
| Subject: | passing a $_POST variable | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-32448@lists.php.net to get a copy of this message | ||
Good day all,
This may be easier than I'm imagining...
The question:
When using the header(location: ...) method for inserting or updating some
$_POST['variable']'s into a MySQL db (preventing repeat insertions or
updates when 'refreshing', etc...), is it possible to return a
$_POST['variable'] from the page that does the insert? I'm imagining that
I'd have to have a form on the insert page with a hidden field to hold the
values(s). But using this line of reasoning, I'm stuck at how the form
would be submitted.
Here's a longer description of the issue:
The main page has 24 radio buttons related to computers on a network. When
the page is initially displayed, none of these are selected. When a button
is clicked, information about the selected computer, such as location, IP
address, MAC, user(s), date of purchase, manufacturer, software installed,
time and date of update, etc..., is displayed in one column, and in a
second column, one has the option to enter new values for these items. So
a user updates the record for the computer, enters username and password,
hits submit, and the data gets sent in the $_POST array to a second page
that does the insert, then redirects back to the main page (I know how to
do all this stuff). What I'd like is for the main page to display the
newly updated data for the just selected computer, along with info for the
user related to the update ( succeeded, failed due to wrong password,
etc..).
I know I could use $_SESSION or $_GET variables for this stuff, but I'm
hoping I can use the $_POST array.
Thank you for taking the time to read this question, and for any thoughts
you might have about it.
David