This is a discussion on "[SOLVED] Form Post Problem" within the PHP Forum section. This forum, and the thread "[SOLVED] Form Post Problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Form Post Problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Hi,
I'm having trouble making a simple enquiry form work. I am using a very basic example. When I click submit I get directed to my thankyou.php but no mail is sent or received. If I remove all but the variable $server_package from sendmail.php I get an empty mail sent. Here is my form code below: Form:
I know there are no stripslashes or anti spam measures but I didn't see much point adding all those things untill I get the inital form up and running. Ideally I would like the form to post all the info provided to it sent in a nice readable format when it arrives. Thanks!!!!!
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
|
|
|
|
#2
|
||||
|
||||
|
Re: Form Post Problem
Hi Weasal,
The reason is that you are sending way too many arguments to the mail function. Separating the variables with commas declares a new argument, you will need to concatenate them with a period.. eg.
Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#3
|
|||
|
|||
|
Re: Form Post Problem
Hey,
Thanks. That got the form to send but all I'm getting is jibberish lol See below:
It just seems to be mailing the last three input boxes but not the drop down options. Thanks Mike
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
|
|
#4
|
||||
|
||||
|
Re: Form Post Problem
forgot to double quote the new lines "\n"... and you need to give the select boxes name="etc" rather just an ID
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#5
|
|||
|
|||
|
Re: Form Post Problem
Thats better but I'm still not getting any results from the drop down options.
Instead I'm getting blank spaces. Am I missing something in my form? Thanks, Mike
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
|
|
#6
|
||||
|
||||
|
Re: Form Post Problem
Yes, you need to give the drop down boxes names the same way as with the input boxes.
name="opporating_system" etc...
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#7
|
|||
|
|||
|
Re: Form Post Problem
Thats what's missing lol... I thought ID="" was the value I needed.. lol
Thanks buddy, much appreciated.
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
|
|
#8
|
|||
|
|||
|
Re: Form Post Problem
How would I get this to display results like so:
Thanks! Another handy feature would be to have the mailed results show the time the mail was sent if thats possible?
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
Last edited by weasel; Oct 8th, 2007 at 22:59. |
|
#9
|
||||
|
||||
|
Re: Form Post Problem
Try this, you can just create an aritrary string out of the variables from the form.
One extra header handles the date
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#10
|
|||
|
|||
|
Re: Form Post Problem
I added the other strings but now it wont send anything.
I assume I have added the other strings correctly?
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
|
|
#11
|
||||
|
||||
|
Re: Form Post Problem
You need to send the headers to the mail function
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#12
|
|||
|
|||
|
Re: Form Post Problem
Thanks,
I have added the $headers string to the mail function but still nothing.
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
|
|
#13
|
||||
|
||||
|
Re: Form Post Problem
There's nothing wrong with the script that I can see.
Have you changed the $toAddress variable to your email addy?
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#14
|
|||
|
|||
|
Re: Form Post Problem
Yes buddy,
I changed the mail address and the thank you url accordingly but when I hit submit, it just goes to a blank page. I have just been double checking that my changes directly reflect what you told me to change and I too cannot see any errors :/ I will PM you the URL if you wish?
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
|
|
#15
|
||||
|
||||
|
Re: Form Post Problem
Syntax error - nearly slipped past
$headers = "From: $contact_name <$contact_email>\n" add a semi colon to the end $headers = "From: $contact_name <$contact_email>\n";
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Last edited by Rakuli; Oct 9th, 2007 at 12:25. |
|
#16
|
|||
|
|||
|
Re: Form Post Problem
Much better
Thanks very much.. your help has been greatly appreciated!!!!!!!!! Many thanks!
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
|