Choose fontsize:
Welcome, Guest. Please login or register.
Did you miss your activation email?

 

Pages: [1]   Go Down
  Print  
Author Topic: PHP - "Enabled Cookies Check"  (Read 9364 times)
0 Members and 1 Guest are viewing this topic.
Member
*

Karma: 2
Gender: Male
Posts: 138



View Profile WWW
« on: July 09, 2005, 01:17:29 AM »
[h1]Enable Cookies Check in PHP[/h1]
Code:
<?php 
if ($MODE!=="elite") { 
SetCookie("COOKIE""VALUE"); 
Header("Location: ".$SCRIPT_NAME."?MODE=elite"); 
exit; 
} else if (
$COOKIE=="VALUE") { 
echo 
"Cookies are enabled"
} else { 
echo 
"Cookies are disabled"

?>


If cookies are enabled, the form will display "cookies are enabled" if not, the } else { function is telling the php code to move on and display the "cookies aren disabled" code, because the cookies wasn't enabled.
« Last Edit: February 10, 2006, 07:35:25 PM by SKETCHi » Logged
Newbie
*

Karma: 0
Gender: Male
Posts: 3


[Zen Chicken]


View Profile
« Reply #1 on: August 31, 2005, 09:02:08 PM »
Parsege: The '!==' should only be '!='.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:      

MickM [ In: 2403 // Out: 2118 ] Pixel-Designz [ In: 1183 // Out: 2917 ] BioRUST [ In: 2951 // Out: 2428 ] Graphic Addicts Topsites [ In: 2435 // Out: 3389 ] SMF Topsites [ In: 0 // Out: 2021 ] Cosmo Designs [ In: 1151 // Out: 1621 ] 3D Tutorial [ In: 1704 // Out: 1813 ] cagedflame [ In: 992 // Out: 1381 ]
Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Phobos design by Bloc | XHTML | CSS


Google visited last this page Today at 04:04:10 PM