Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Parse error: syntax error, unexpected T_STRING
Old 07-06-2009, 08:00 AM Parse error: syntax error, unexpected T_STRING
Junior Talker

Posts: 2
Name: Peter Pinto
Trades: 0
I am a newbie please help me I keep getting this error"Parse error: syntax error, unexpected T_STRING "

Also I need help with line breaks please.between these
. $name
. $telephone
. $email
. $message

Here is the script below.

<?php
session_start();
if( $_SESSION['6_letters_code'] == $_POST['6_letters_code'] && !empty($_SESSION['6_letters_code'] ) ) {
$to = "pinto56@optusnet.com.au";
$email_subject = "This is the email subject";
$name = $_POST['name'];
$telephone = $_POST['telephone'];
$email = $_POST['email'];
$message = $_POST['message'];
$email_body = "You have received a new message from "
. $name
. $telephone
. $email
. $message; ". Here is the message: "
mail($to, $email_subject, $email_body);
ob_start(); echo "Test"; header("Location: http://www.troyspaintingservices.com.au/thanks.html"); ob_flush();
} else {
ob_start(); echo "Test"; header("Location: http://www.troyspaintingservices.com.au/error.html"); ob_flush();
}
?>
pinto56 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-06-2009, 08:32 AM Re: Parse error: syntax error, unexpected T_STRING
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
PHP Code:
email_body "You have received a new message from "
$name
$telephone
$email
$message". Here is the message: "//<--- Here is the error. You cannot concatenate a string after the ; 
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 07-07-2009, 06:39 AM Re: Parse error: syntax error, unexpected T_STRING
Junior Talker

Posts: 2
Name: Peter Pinto
Trades: 0
So what is the alternate option?
pinto56 is offline
Reply With Quote
View Public Profile
 
Old 07-07-2009, 07:18 AM Re: Parse error: syntax error, unexpected T_STRING
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Duh...
Correct it:
PHP Code:
$message.". Here is the message: "
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Parse error: syntax error, unexpected T_STRING
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20184 seconds with 12 queries