|
|
|
|
![]() ![]() |
Jun 8 2006, 04:07 PM
Post
#1
|
|
|
Never alone with Christ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 646 Joined: 22-July 05 Member No.: 9,713 |
Okay, here is what I got. I know, three topics on form scripts, but hey, I am learning. I used a generator, and then put it on, but it is giving me a santax (is that how you spell it) on line 13 with an unexpected = sign. I recited taht the best I could. Anyway, so I need some help. The form is located in http://inneed.mxweb.co.uk/askandanswer.html The script behind the whole works, I named, aaform.php. Moving right along here, I got this error, so here is the code that I called aaform.php, you know the one that works the whole thing:
CODE <?php // Website Contact Form Generator // http://www.tele-pro.co.uk/scripts/contact_form/ // This script is free to use as long as you // retain the credit link // get posted data into local variables $EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); $EmailTo = "justin.1390@gmail.com"; $Subject = "A&A form"; $Subject = Trim(stripslashes($_POST['Subject'])); $Email = Trim(stripslashes($_POST['Email'])); $Canweputthisonthewebsite? = Trim(stripslashes($_POST['Canweputthisonthewebsite?'])); $Question: = Trim(stripslashes($_POST['Question:'])); // validation $validationOK=true; if (Trim($EmailFrom)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "Subject: "; $Body .= $Subject; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Canweputthisonthewebsite?: "; $Body .= $Canweputthisonthewebsite?; $Body .= "\n"; $Body .= "Question:: "; $Body .= $Question:; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">"; } ?> My question is, what = on line 13, which I found but don't know how to change is causing the problem, and how do I then fix it. Thanks in advance! Note: This is the right code, sorry about posting that other one, I copied the wrong one. This post has been edited by wild20: Jun 8 2006, 04:55 PM |
|
|
|
Jun 8 2006, 04:17 PM
Post
#2
|
|
|
Incest is a game the whole family can play. ![]() Group: [MODERATOR] Posts: 1,232 Joined: 11-February 05 From: Heaven Member No.: 3,709 myCENT:53.83 |
QUOTE(wild20) santax (is that how you spell it) It's syntax. The error's in the file aaform.php but that's not the code for that file, it's html code for the form. The error is in the script that sends the form. |
|
|
|
Jun 8 2006, 04:54 PM
Post
#3
|
|
|
Never alone with Christ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 646 Joined: 22-July 05 Member No.: 9,713 |
Oh man! Sorry C-mat. Hold on, I will revise that. I copied the wrong thing. Yeah, I am not that php illiterate.
|
|
|
|
Jun 8 2006, 09:33 PM
Post
#4
|
|
|
Ephesians 6:10-17 ![]() Group: [MODERATOR] Posts: 1,971 Joined: 22-June 05 From: somewhere... Where am i? Member No.: 8,528 myCENT:58.42 |
Remove the question mark from every instance of: $Canweputthisonthewebsite?
Such would fix the problem. Rule for variables to keep in mind: QUOTE A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
This post has been edited by truefusion: Jun 8 2006, 09:39 PM |
|
|
|
Jun 8 2006, 09:55 PM
Post
#5
|
|
|
Never alone with Christ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 646 Joined: 22-July 05 Member No.: 9,713 |
Truefusion! You are a genius. Worked perfectly, now I understand how it works. There are a few characters used in PHP that should not be used as field names. If you want something to say, First Name: Then you need to name the field something like
CODE firstname to keep it from using the QUOTE : ? or / sign as a code . Finally I know now. Thanks for all you help!
|
|
|
|
Jun 8 2006, 09:59 PM
Post
#6
|
|
|
Ephesians 6:10-17 ![]() Group: [MODERATOR] Posts: 1,971 Joined: 22-June 05 From: somewhere... Where am i? Member No.: 8,528 myCENT:58.42 |
Heh, knowledge is everywhere, just gotta know where to look. But, glad it helped. Good to hear that you understand.
|
|
|
|
Jun 8 2006, 10:04 PM
Post
#7
|
|
|
Never alone with Christ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 646 Joined: 22-July 05 Member No.: 9,713 |
Yup, thanks again. I think I can FINALLY make a script that will work now. lol. Hey thanks again for your help. I like the custom title. See you around and God bless!
|
|
|
|
![]() ![]() |
Similar Topics
|