Jump to content

First time PHP user - Help submitting survey/form and e-mail site owner results


Wgkadvert

Recommended Posts

Hello.

 

I am new to PHP and need assistance with the PHP code for submitting a form/survey via e-mail to the site owner.

 

I have created the survey and would like for the user to be taken to a success page where the score from the survey is displayed after they hit the submit button, and then have the results e-mailed privately to the site owner. Right now, the results are being displayed in the HTML document.

 

Any assistance that you may be able to give me would be greatly appreciated. I have searched many websites and forums and have found a few that work the way I would like, but since I am new to PHP, I am unable to implement them into my project.

 

Here is the link to our test page

 

http://www.advertools.net/smokingquiz.html

Link to comment
Share on other sites

The best way to solve this, would be to save the results in a database (or something like that), grab the ID of the row, and then redirect the user to the "confirmation" page after successful submission.

The mailing itself is done right before you redirect the user, and is pretty much done in the exact same way as a contact script is set up. In fact, the PHP manual page for mail () should have all of the information you need for this bit.

 

If you're still stuck with the code, then we can always help you out. Just remember to post the (relevant) code in

 tags, along a detailed explanation of what you're trying to accomplish with the code, what you expected it to give you, and what it is actually doing.

Should you be getting any error messages, then posting the complete message would also be most helpful. After you've done a search for it on the net, of course. ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.