Jump to content

contact form script on one page


jmcall10

Recommended Posts

Hi guys,

 

I was wondering if someone with good experience could help me out.

 

Basically all I would like is a contact form script (easy I know) however there is a few requirements that I cannot find a good solution for.

 

the requirements are as follows:

  • script must be in one page (i.e. call itself)
  • After the form has been submitted I would like the users variables echo'd to the user (just to show what contact info they have submitted)
  • If after form submission the user hits refresh then I would like them to be presented with form again or something saying you have submitted a form etc

 

I can do the first two bullet points but the third is were I am stuck and cannot see a way round it.

 

Basically the way my script is just now, the user is initially presented with the form and after submission the form is sent via the mail function and the user is shown the info in each of the variables they submitted with a thank you. At this point if the user hits the refresh button the user is shown their info again and another submission is sent.

 

There must be a way round this. I have tried unsetting the $_POST variables etc.

 

If someone could either show me an example of thiers working or even guide me that would be much appreciated.

However I have had many people saying "this will work" then it doesnt, because they actually didnt know if it would or not lol.

 

That wasnt meant nasty incase it was taken that way, im just looking for a real solution or even a reason as to why this cant be done.

 

Thanks in advance

 

jmcall10

Link to comment
https://forums.phpfreaks.com/topic/202084-contact-form-script-on-one-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.