PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ethoemmes
Forum Commoner
Posts: 26 Joined: Thu Aug 18, 2005 4:11 pm
Post
by ethoemmes » Tue Sep 13, 2005 4:51 pm
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
Roja
Tutorials Group
Posts: 2692 Joined: Sun Jan 04, 2004 10:30 pm
Post
by Roja » Tue Sep 13, 2005 4:58 pm
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.
m3mn0n
PHP Evangelist
Posts: 3548 Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada
Post
by m3mn0n » Tue Sep 13, 2005 9:36 pm
Your echo needs a semi-colon also.