RE: [PHP-WIN] Cookies
| From: | Robert Collins | Date: | Tue, 14 Nov 2000 15:42:01 +0000 |
| Subject: | RE: [PHP-WIN] Cookies | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-3834@lists.php.net to get a copy of this message | ||
Your code worked fine for me as it was. But if you are still having problems
this might work for you.
<?
function registered($mywapfone_registered){
if ($mywapfone_registered){
echo "Yes";
} else {
echo "No";
}
}
@registered($mywapfone_registered);
?>
By calling it as a function and putting the "@" in front of the function
call you can suppress the errors. This may not be the best way to do it but
it should wor for you.
Robert W. Collins
Web Developer II
Insight / TC Computers
www.insight.com
www.tccomputers.com
-----Original Message-----
From: Ben Cairns [mailto:BenC@intasept.com]
Sent: Tuesday, November 14, 2000 8:20 AM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Cookies
I am using this bit of code to check for a cookie,
<?
if ($mywapfone_registered){
SOME CODE HERE
}
else
{
do something else here;
}
?>
As you can see the cookie name is mywapfone_registered. This works in PHP3,
but not 4, it says:
Warning: Undefined variable: mywapfone_registered in
d:\apache\htdocs\devel\wapsite\builder\index.php on line 3
Can I suppress this error message, as the cookie check works, or there new
code that I should know about for php4?
-- Ben Cairns, Head Of Technical Operations, Intasept.com
E-Mail: BenC@intasept.com | Web: http://www.intasept.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net