Thread: Cookies...
View Single Post
Old 11-05-2004, 10:32 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,503
sde is on a distinguished road
hey buchannon, .. the syntax of php is a lot like javascript, so it probably wouldn't be that difficult to pick it up. there's tons of support for php all over the internet, and you'de probably get quite a bit of help right here too.

here is the reason .. anyone can turn javascript off in their browsers .. since javascript runs on the client, there are way to many things that can go wrong.

when you use a server-side languge, it will run the same no matter who is accessing it. that and you have a LOT more power over everything from string manipulation to hard-core socket programming if you wished to get that deep.

here is how easy it is to set cookies in php:
PHP Code:
<?
$value 
'something from somewhere';
setcookie("TestCookie"$valuetime()+3600);  /* expire in 1 hour */
?>
<html>
<body>
... the rest of your web page here ..
and here is how you would print cookie info to the browser:
PHP Code:
<html>
<body>
the value of my cookie is: <?=$_COOKIE['TestCookie']?>
__________________
Mike
sde is offline   Reply With Quote