PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
i want to update 2 tables, the POST works fine as well as the the query
the problem is that:
1. the isset() is not working
2. also when i refresh the page from the address bar the values are (0 probably related to the isset() )
3. where should i put the header()?(i want it to submit and return to the same page but need to POST the form variables to run the form action.)
if (isset($_POST['submit'])) {
header("Location update_2tables.php?PropID='.$ProposalID.'");
Also, redirecting using the header function will not preserve the POST array.
To check whether the submit button is causing the $_POST['submit'] to be set, you can add this to the top of your file:
echo "POST: <BR>";
print_r($_POST);
Robert07 wrote:If you would explain what happens when you tried the suggestions above, that would help others to help you.
this is the response i get
UPDATE proposals, contact_form SET contact_form.StatusID = '0097097', proposals.StatusID= '0097097' WHERE proposals.RequestID = contact_form.RequestID AND proposals.ProposalID = '3'
Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\lanirltdcom\backoffice\update_2tables.php:4) in C:\wamp\www\com\backoffice\update_2tables.php on line 40
POST:
Array ( [StatusID] => 0097097 [RequestID] => [submit] => Submit )
Oh, so you did. My bad. I was looking at your second post.
But yeah, look at your own script...you've got all that HTML before the header() function. Put the whole thing in an if() condition checking to see if the form has been submitted....either by checking to see if one of your form elements exists in the post array, or sizeof($_POST), or $_SERVER['REQUEST_METHOD'] == 'POST'...
jackpf wrote:Oh, so you did. My bad. I was looking at your second post.
But yeah, look at your own script...you've got all that HTML before the header() function. Put the whole thing in an if() condition checking to see if the form has been submitted....either by checking to see if one of your form elements exists in the post array, or sizeof($_POST), or $_SERVER['REQUEST_METHOD'] == 'POST'...
Or you could just use output buffering.
an example could help,
this is exactly the layout problem i have
thanks