[thelist] in-principle, PHP/mySQL shopping basket question

Aredridel aredridel at nbtsc.org
Wed Jul 23 13:12:06 CDT 2003


On Wed, 2003-07-23 at 10:16, john at johnallsopp.co.uk wrote:
> Is there a way of checking whether the user client has cookies enabled? In
> PHP that is.

Set a cookie and see if it comes back.

<?php

	if($_GET['stage'] == 2) {
		if($_COOKIE['test'] == 'test') {
			print('Cookies enabled');
		} else {
			print("Cookies disabled");
		}
	} else {
		setcookie('test', 'test');
		header("Location: ".$_SERVER['PHP_SELF'].'?stage=2');
	}

?>

Ari
> 
> Cheers
> J
> 



More information about the thelist mailing list