Jegajothy vythilingam
asked on
PHP Programming
My OS is win 7 64 bit and I am trying to write a short PHP file, but I am getting an error just after the line : include ('rightbar.php'). The error is :
PHP Parse error: syntax error, unexpected '}' in C:\wamp\www\sattv\icontact .php on line 19
I am using the wamp App for this exercise and the file is saved in the above directory.
If I leave the following line, header('Location: http://www.satellitedirect.com/');
the error is on that line, and if I were to comment out this line, then the error is on the next line of the code at '}'
The error for the '}' is
PHP Parse error: syntax error, unexpected '}' in C:\wamp\www\sattv\icontact .php on line 19
I am just getting into PHP and trying to create some practice Apps. Any help will be appreciated. Please let me know what I am doing wrong. thank u.
The code is :
<html>
<head>
</head>
<body>
<?php
$value = $_GET['mail'];
if (empty($value) || $value == "Your Primary Email"){
header('Location: http://www.satellitedirect.com/');
}else{
// $handle = fopen('icontactlist.txt', 'a');
// fwrite($handle, " ".$value);
// fclose($handle);
include ('rightbar.php')
header('Location: http://www.satellitedirect.com/');
}
?>
</body>
</html>
PHP Parse error: syntax error, unexpected '}' in C:\wamp\www\sattv\icontact
I am using the wamp App for this exercise and the file is saved in the above directory.
If I leave the following line, header('Location: http://www.satellitedirect.com/');
the error is on that line, and if I were to comment out this line, then the error is on the next line of the code at '}'
The error for the '}' is
PHP Parse error: syntax error, unexpected '}' in C:\wamp\www\sattv\icontact
I am just getting into PHP and trying to create some practice Apps. Any help will be appreciated. Please let me know what I am doing wrong. thank u.
The code is :
<html>
<head>
</head>
<body>
<?php
$value = $_GET['mail'];
if (empty($value) || $value == "Your Primary Email"){
header('Location: http://www.satellitedirect.com/');
}else{
// $handle = fopen('icontactlist.txt', 'a');
// fwrite($handle, " ".$value);
// fclose($handle);
include ('rightbar.php')
header('Location: http://www.satellitedirect.com/');
}
?>
</body>
</html>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank u for your sharp eyes. Goes without saying, your tons of experience can spot a boo boo a mile way.
ASKER
PHP Notice: Undefined index: mail in C:\wamp\www\sattv\icontact
fyi, line 7 = $value = $_GET [ 'mail'];
and line 10 is : header('Location: http://www.satellitedirect.com/');
My apologies and thank u for noting that missing ;.