Page 1 of 1

Simple Error

Posted: Tue Sep 13, 2005 4:51 pm
by ethoemmes
Can anyone spot the error in the following code?

I am getting the following error.
Parse error: parse error, unexpected T_VARIABLE in /usr/local/psa/home/vhosts/rrbltd.com/httpdocs/Development/form_error.php on line 6

Code: Select all

<?php
session_start();
header("Cache-control: private");

$Title = $_SESSION['Title']
$FirstName = $_SESSION['FirstName']
$LastName = $_SESSION['LastName']
$Email = $_SESSION['Email']

echo 'Please make sure you have entered all of the required information.'

if (empty($Title)) {
echo 'Title';
}
if (empty($FirstName])) {
echo 'First Name';
}
if (empty($LastName)) {
echo 'Last Name';
}
if (empty($Email)) {
echo 'Email';
}

?>
TIA

Re: Simple Error

Posted: Tue Sep 13, 2005 4:58 pm
by Roja
ethoemmes wrote:Can anyone spot the error in the following code?
You mean beside the fact that every variable definition needs to have a semicolon after it?

Code: Select all

$Title = $_SESSION['Title']<---- No semicolon
$FirstName = $_SESSION['FirstName'];<-- add that.

Posted: Tue Sep 13, 2005 9:36 pm
by m3mn0n
Your echo needs a semi-colon also.