Work at Home Forum - An online community of those who work from home.
Web Design and Hosting Work at Home Forum / Web Design and Hosting /

Error Messages when Using Contact.php

Author Message
embreys
Forums Member
Joined: 31 May 2011
Posts: 2
#1 · Posted: 31 May 2011 10:35


Hi,

A new member so forgive me if the question seems basic to some people.

I have put together a basic website and I want to use a form to initiate contact from potential customers. The website is for my partner who has started her own business.

I have used iWeb to put the site together and created the form using a HTML snippet. In order for the form to send direct to her e-mail account, I did some research and found a simple php file that I could plagiarise for my own purposes.

However, when I have uploaded it, and then test it on the server, I get the following message;

Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting T_STRING in ......../public_html/index/Contact_files/contact.php on line 10

I am no expert in php writing. The main contact form (contact.html) is in the public_html/index directory and the contact.php file is as stated in the error message.

The php script I have is shown below (the correct e-mail address is substituted below for a generic fake);

<?php
if(isset($_POST['submit'])) {
$to = "[email protected]";
$subject = "Website Contact - We would like a quote.....";
$First Name_field = $_POST['First Name'];
$surname_field = $_POST['surname'];
$address1_field = $_POST['address1'];
$town_field = $_POST['town'];
$postcode_field = $_POST['postcode'];
$telephone_field = $_POST['telephone'];
$mobile_field = $_POST['mobile'];
$email_field = $_POST['email'];
$enquiry = $_POST['enquiry'];

$body = "From: $name_field $surname_field\n Address: \n $address1_field\n $town_field\n $postcode_field/n Contact: \n Telephone: $telephone_field\n Mobile: $mobile_field\n E-mail: $email_field\n Message:\n $enquiry";

echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>


Any ideas why I get the error that I do? The HTML snippet that creates the form in iWeb definitely has "contact.php" as the action for the form.

Thanks

Steve

__________________
A beginner who has got so far, but now needs a helping hand
talfighel
Silver Member
Joined: 17 Mar 2007
Posts: 1175
#2 · Posted: 1 Jun 2011 09:48 · Edited by: talfighel


I think that this is the code that you should be using if you use .PHP on your site.

<?php

header( 'Location: AFFILIATE LINK HERE' );

?>


Make sure you name your subsite something like this:

www.YOURSITE.com/myoffer.php

__________________
Work At Home "TOP CHOICE"
The Best And Easiest Way To Make
Real Money Online In My View! Period.
embreys
Forums Member
Joined: 31 May 2011
Posts: 2
#3 · Posted: 4 Jun 2011 08:05


talfighel:
I think that this is the code that you should be using if you use .PHP on your site.

<?php

header( 'Location: AFFILIATE LINK HERE' );

?>

I am not sure what you mean by this?? Affiliate link?

Thanks

__________________
A beginner who has got so far, but now needs a helping hand
Just2EZ
Silver Member
Joined: 14 Nov 2010
Posts: 732
#4 · Posted: 4 Jun 2011 12:45


embreys:
$postcode_field/n Contact:

Maybe a forward slash instead of a backslash?

__________________
Takuyah
Forums Member
Joined: 3 Jun 2011
Posts: 10
#5 · Posted: 5 Jun 2011 23:54


You can use this free service from http://www.emailmeform.com.

You can customize the contact form and paste the codes into your webiste.

__________________
Your Reply
   :) ;) :-( ... Disable smilies

» Username  » Password 
Only registered users are allowed to post here. Please enter your login/password details upon posting a message, or sign up first.
Messages not conforming to the forum rules will not be approved or, deleted without any explanation.
Please do not post email addresses. If essential, obfuscate them (user [at] domain.com or something like that).
Please do not apply BOLD to entire post.
Please do not post Titles in all CAPS.
 


Page loading time (secs): 0.027

Custom Search
Member Ranking · Terms of Use · Privacy Policy · About Us · Contact Us · Support Us · Friends

© 2004-2011 Work at Home Forum. All rights reserved.