Jump to content
xisto Community
Sign in to follow this  
wild20

Yet Another Problem With A Form Script Maybe I should just use email? lol

Recommended Posts

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://forums.xisto.com/no_longer_exists/ 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:

<?php// Website Contact Form Generator // http://forums.xisto.com/no_longer_exists/ // 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. :rolleyes:
Edited by wild20 (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Remove the question mark from every instance of: $Canweputthisonthewebsite?

Such would fix the problem.

 

Rule for variables to keep in mind:

A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.

Edited by truefusion (see edit history)

Share this post


Link to post
Share on other sites

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

firstname
to keep it from using the

: ? or / sign as a code

. Finally I know now. Thanks for all you help!

Share this post


Link to post
Share on other sites

Heh, knowledge is everywhere, just gotta know where to look. But, glad it helped. Good to hear that you understand.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.