Link to home
Start Free TrialLog in
Avatar of Jegajothy vythilingam
Jegajothy vythilingamFlag for United States of America

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>
SOLUTION
Avatar of zappafan2k2
zappafan2k2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jegajothy vythilingam

ASKER

in response to zappafan, when I corrected it, and compiled and published it, the error is now:
PHP Notice: Undefined index: mail in C:\wamp\www\sattv\icontact.php on line 7 PHP Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\sattv\icontact.php:5) in C:\wamp\www\sattv\icontact.php on line 10
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 ;.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank u for your sharp eyes.  Goes without saying, your tons of experience can spot a boo boo a mile way.