Simple Error

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

Post Reply
ethoemmes
Forum Commoner
Posts: 26
Joined: Thu Aug 18, 2005 4:11 pm

Simple Error

Post 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
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: Simple Error

Post 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.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Your echo needs a semi-colon also.
Post Reply