Page 1 of 1

GET and POST variables returned by Outlook

Posted: Thu Sep 21, 2006 4:02 am
by thesleeper
Hi all, I'm running into a problem with form variables.

Heres the scenario:

I have a questionnaire form which is received via email and which the user fills out and submits. This form data is sent through to our PHP page to process and enter into the database.

If I specify that the form method="GET", then everything works fine with no hiccups.
However, when I specify that the method="POST" (I have to do this with one form in particular where a user needs to upload a personal image along with their form submission) no form data is delivered to the PHP page.

But, if I click on the "Refresh" button in IE when it pops up, and then click on "Retry" when this message box comes up, the form information is then sent through. So far I've gotten around this by adding a message when IE pops up (when the form submit button is clicked) prompting the user to click the "Refresh" button. I'm sure this cant be the best solution and it also doesnt work in Mozilla (no form data is "resubmitted" when the "Refresh" button is clicked.

So the form data is being sent through, but for some reason not on the first attempt.

Anyone encountered this, or can help? Much appreciated.

Posted: Thu Sep 21, 2006 4:46 am
by aaronhall
Might be a good idea to post some code

Posted: Thu Sep 21, 2006 6:00 am
by thesleeper
patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Well here's a very simplifyed version of the code for each.

Form which is received in the email:

Code: Select all

<form enctype="multipart/form-data" action="webpage.php" method="POST">
 <input type="hidden" name="form_complete" value="true" />
 <input type="hidden" name="MAX_FILE_SIZE" value="20000000" />

 Person name: <input type="text" name="form_name" size=40 /><br>
 Image: <input type="file" name="userfile" size=40 />

 <input type="submit" value="Submit" />
</form>
Code on webpage.php:

Code: Select all

<?php
if (isset($_POST['form_complete']))
{
     // add the form data into the database
     // This code only executes and receives POST information once the user has clicked the "Refresh" button in the IE window which opens
     // nothing happens when this page is first opened by clicking on the Submit button. i.e no POST information seems to be submitted. 
}
?>
Let me know if that makes sense, but thats the just of it.
Thanks


patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]