IPB

Welcome Guest ( Log In | Register )



Tags
This content has not been tagged yet
 
Reply to this topicStart new topic

Yet Another Problem With A Form Script

, Maybe I should just use email? lol


wild20
no avatar
Never alone with Christ
*********
Group: Members
Posts: 647
Joined: 22-July 05
Member No.: 9,713



Post #1 post Jun 8 2006, 04:07 PM
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
no avatar
Incest is a game the whole family can play.
***********
Group: [MODERATOR]
Posts: 1,239
Joined: 11-February 05
From: Heaven
Member No.: 3,709
myCENT:59.86



Post #2 post Jun 8 2006, 04:17 PM
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
no avatar
Never alone with Christ
*********
Group: Members
Posts: 647
Joined: 22-July 05
Member No.: 9,713



Post #3 post Jun 8 2006, 04:54 PM
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
no avatar
Do you want to know?
****************
Group: [MODERATOR]
Posts: 2,728
Joined: 22-June 05
From: 127.0.0.1 — no place like it.
Member No.: 8,528
myCENT:79.60



Post #4 post Jun 8 2006, 09:33 PM
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
no avatar
Never alone with Christ
*********
Group: Members
Posts: 647
Joined: 22-July 05
Member No.: 9,713



Post #5 post Jun 8 2006, 09:55 PM
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
no avatar
Do you want to know?
****************
Group: [MODERATOR]
Posts: 2,728
Joined: 22-June 05
From: 127.0.0.1 — no place like it.
Member No.: 8,528
myCENT:79.60



Post #6 post Jun 8 2006, 09:59 PM
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
no avatar
Never alone with Christ
*********
Group: Members
Posts: 647
Joined: 22-July 05
Member No.: 9,713



Post #7 post Jun 8 2006, 10:04 PM
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

    Topic Title Replies Topic Starter Views Last Action
No New Posts   2 (G)Pradeep Yadav 245 29th August 2009 - 12:04 PM
Last post by: minimcmonkey
No New Posts   5 Shibbeh 16,135 20th August 2004 - 10:04 PM
Last post by: ill
No New Posts   11 velma 1,909 14th August 2009 - 12:14 PM
Last post by: sheepdog
No New Posts 4 hatebreed 9,704 10th August 2004 - 11:10 AM
Last post by: hatebreed
No New Posts   6 LuciferStar 11,475 7th November 2004 - 12:40 PM
Last post by: eldeo
No New Posts   1 mmbg 7,158 13th August 2004 - 06:01 PM
Last post by: odomike
No New Posts   9 shadowx 3,328 12th October 2009 - 07:12 PM
Last post by: manish-mohania
No New Posts   4 xmae 9,165 24th August 2006 - 03:21 PM
Last post by: juice
No New Posts   1 SilverBoarder 8,687 17th August 2004 - 04:05 PM
Last post by: odomike
No New Posts   7 football123213 15,618 20th August 2004 - 12:25 AM
Last post by: ill
No New Posts   3 Mario 7,398 21st August 2004 - 01:31 PM
Last post by: X3r0X
No new   15 -prodigy- 14,185 27th February 2005 - 10:22 PM
Last post by: alexia
No New Posts   2 -Pandemonium- 12,096 22nd August 2004 - 04:25 AM
Last post by: -Pandemonium-
No New Posts   8 -Pandemonium- 9,340 25th August 2004 - 04:00 PM
Last post by: -Pandemonium-
No New Posts   3 Vacant 7,857 26th August 2004 - 09:09 AM
Last post by: Vacant


 



RSS Open Discussion Time is now: 22nd November 2009 - 07:06 AM

Web Hosting Powered by ComputingHost.com.