Jump to content

[SOLVED] Cookies not working???


AV1611

Recommended Posts

I don't understand why this script doesn't keep people from typing the url in the browser instead of a form directing them to the site...  when they type http://xxxxxx.com/index.php it displays the page but it should redirect them to the portal page??????????????

 

<?php
if(isset($_POST['password'])){
if($_POST['password']=='xxxxxx'){
	setcookie("authorized", 'AUTHORIZED', time()+14400);
	}
else{
	setcookie("authorized", 'HACKER', time()+14400);
	header('http://xxxxxx.com');
	}
}
elseif(isset($_REQUEST['authorized'])){
if($_REQUEST['authorized']!='AUTHORIZED'){
	setcookie("authorized", 'HACKER', time()+14400);
	header('http://xxxxxx.com');
	}
}
else{
header('http://xxxxxx.com');
}

Link to comment
https://forums.phpfreaks.com/topic/49564-solved-cookies-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.