| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		Gramps -
 
  Joined: 04 Jan 2006 Posts: 1
 
  | 
		
			
				 Posted: Wed Jan 04, 2006 8:26 pm    Post subject: Cookies | 
				      | 
			 
			
				
  | 
			 
			
				New to this site and dumb as a doorknob.  Is there a tutorial for setting cookies?  Sure would like to know how.
 
Thanks,
 
Gramps (Too old to know what you young geniuses are up to) | 
			 
		  | 
	
	
		| Back to top | 
		
			          | 
		
	
	
		  | 
	
	
		AbyssUnderground -
 
  Joined: 31 Dec 2004 Posts: 3855
 
  | 
		
			
				 Posted: Wed Jan 04, 2006 8:30 pm    Post subject:  | 
				      | 
			 
			
				
  | 
			 
			
				Try www.google.com and search for PHP cookies, there are lots of tutorials for you to look at. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
 
www.abyssunderground.co.uk | 
			 
		  | 
	
	
		| Back to top | 
		
			           | 
		
	
	
		  | 
	
	
		cmxflash -
 
  Joined: 11 Dec 2004 Posts: 872
 
  | 
		
			
				 Posted: Wed Jan 04, 2006 11:01 pm    Post subject:  | 
				      | 
			 
			
				
  | 
			 
			
				It's pretty simple.
 
 
Here's how you write a cookie, using PHP:
 
 	  | Code: | 	 		  
 
<?php
 
setcookie("The name of the cookie", "The content");
 
?>
 
 | 	  
 
Note: This code must be in the beginning of the code.
 
 
And if you want to read a cookie:
 
 
 	  | Code: | 	 		  
 
<?php
 
$cookie = $_COOKIE['The name of the cookie'];
 
 
echo $cookie;
 
 
?>
 
 | 	  
 
 
If you want to read more about cookies, visit http://se.php.net/manual/sv/function.setcookie.php | 
			 
		  | 
	
	
		| Back to top | 
		
			          | 
		
	
	
		  | 
	
	
		 |