Navigation
Poll
Would you be an active poster if Ron's Guide had a message board?


Total Votes: 62
Comments: 18 — View
Past pollsPoll idea?
Rate Ron's Guide
Rate our resource at Bigwebmaster.com
Discuss Tutorial: Cookies via PHP 14 Comments
Comment by Ron on Feb 4, 2006, 8:07 am
Please post questions or comments about this tutorial below. Smile
Comment by Brian on Feb 7, 2006, 10:30 pm
Could I do something like

if($_COOKIE[\'blah\']){
echo \'logged in\';
}

to check if a cookie exists?
Comment by Ron on Feb 7, 2006, 10:50 pm
If you want to check if the cookie exists use the isset function. Like this:

if(isset($_COOKIE[\'mycookie\'])) {
echo \"The cookie exists!\";
}
Comment by Teco on Feb 9, 2006, 4:03 pm
Well play\'ed arround with this tut, and i\'m now using it on my site for my friendNet system to check login cookies... Cool

Really nice Ron Smile
Comment by Bfr on Feb 11, 2006, 2:14 am
Another great tutorial, Ron. It was about time you made another tutorial Tongue
Comment by Ron on Feb 16, 2006, 7:12 am
Excellent, Glad it was helpful Teco. Smile

Thank you Bfr Smile
Comment by Kingjokin on Jul 9, 2006, 1:15 pm
Can i use form variables as perameters for my cookie. like to log a person in directly upon registration?
Comment by Ron on Jul 10, 2006, 5:28 am
Yes, you could do that.
Comment by Kingjokin on Jul 10, 2006, 9:47 pm
allright., how?
Comment by Ron on Jul 11, 2006, 6:45 am
well, you could do something like:

<?php

setcookie('username', $_POST['username']);

?>

That would set the cookie "username" to the value of the username field passed through a post form.

« Previous [ 1 2 ] Next »
Post a comment
Sorry, you must be a registered member to post comments.

If you would like to register, you can do so here.
If you already have an account, please login.