Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Yet Another Problem With A Form Script, Maybe I should just use email? lol
wild20
post 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. laugh.gif

This post has been edited by wild20: Jun 8 2006, 04:55 PM
Go to the top of the page
 
+Quote Post
electriic ink
post Jun 8 2006, 04:17 PM
Post #2


Incest is a game the whole family can play.
Group Icon

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.
Go to the top of the page
 
+Quote Post
wild20
post 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. laugh.gif
Go to the top of the page
 
+Quote Post
truefusion
post Jun 8 2006, 09:33 PM
Post #4


Ephesians 6:10-17
Group Icon

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
Go to the top of the page
 
+Quote Post
wild20
post 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!
Go to the top of the page
 
+Quote Post
truefusion
post Jun 8 2006, 09:59 PM
Post #6


Ephesians 6:10-17
Group Icon

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.
Go to the top of the page
 
+Quote Post
wild20
post 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!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Many Php Script Sites(16)
  2. Script: Php Jukebox(6)
  3. Parse: Error Unexpected T_lnumber(4)
  4. Transfer Variables To Another Php Script(9)
  5. Watermark Your Image With Simple Php Script(35)
  6. Wappychat_oldskool(15)
  7. Free Auction Script(6)
  8. Wappy Buddy V1.10 - Tibia Gold Edition By Wappy & Jon Roig(3)
  9. What Kind Of Script Do You Need ?(15)
  10. Creatting A Playlist Through Php(5)
  11. Very Simple Online Now Script(4)
  12. Html Code Tester. Online Script(15)
  13. Php Downloads Script(4)
  14. Script Help Required: Undefined Variable(3)
  15. Library Script(6)
  1. How Would I Go About Making A Simple "counting" Script?(3)
  2. Forum Script(3)
  3. Php Rediret Script(12)
  4. An Interesting Approach To Email Verification...(6)
  5. Download Script For Mp3 Files(0)
  6. How Do I Connect To Live Database With Php Script?(6)
  7. Need Help Installing Dolphin Community Script!(5)
  8. Guessing Php Script(2)
  9. How To Make A View New Post Script?(5)
  10. Php Guest Online Script(3)
  11. How To Make Php Newsletter Script(3)
  12. A Question About Php Mail(1)
  13. How To Send Email From Local Wamp To Internet(0)


 



-