So I'm using $_GET
to capture the URL to use it later but when I use $_GET
it wont redirect!
So here's my sample code:
URL : http://localhost/project/active.php/?s=ieugfshd&h=qwuyrbcq&i=1
php code:
<?php
include 'init.php';
$s = trim($_GET['s']);
$h = trim($_GET['h']);
$i = trim($_GET['i']);
$q = key_check($s,$h,$i);
if($q == 1)
{
header("location:password_active.php");
exit;
}
if($q == 0)
{
header("location:login_failed.php");
exit;
}
?>
EDIT:
key_check( ) function
function key_check($k1,$k2,$id)
{
$query = mysql_query("select key1 from users where user_id = '$id'");
$key1 =mysql_result($query,0);
$query = mysql_query("select key2 from users where user_id = '$id'");
$key2 =mysql_result($query,0);
$y=strcmp($k1,$key1);
$z=strcmp($k2,$key2);
if($y || $z == 0)
{
return 1;
}
else
{
return 0;
}
}
Now when I try this, I got "1" but I'm getting
This web page has a redirect loop
But my password_active.php
doesn't have any redirects. It's just an html page.