Always getting a parse error
| From: | Dennis Hoffmann | Date: | Sun, 25 Aug 2002 14:26:01 +0000 |
| Subject: | Always getting a parse error | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-15494@lists.php.net to get a copy of this message | ||
Hi,
I'm a newbie (you guessed, right?) :-)
My problem is: I'm trying to set a cookie.
There are 2 pages involved, the first of which containing a form:
<form action=setcookie.php method=GET>
<input type=text name=name>NAME<br>
<input type=text name=email>Email<br>
<input type=submit name=submit value=SEND>
</form>
.
.
.
The 2nd file is setcookie.php, and so far I have the following code:
if (!empty($name) && !empty($email) && !empty($submit)
{ $content = array("name"=>$name, "email"=>$email);
setcookie("testcookie", $content, time()+3600); }
else
{ echo "There was a mistake!"; }
The error I receive is a "parsing error in line 7" which is exactly the
else-command.
Which mistake have I made, and how can I set that cookie?
Greets, Mr. Hatch.