Jump to content

Recommended Posts

the only page i see  is this(correct me if im wrong)

[code]<?
include ("config.php");
include ("errors.php");
include ("common.php");
include ("connect.php");


while (list($var, $val) = each ($_REQUEST))
{
IF ($var == "cookieid" AND !isset($_COOKIE[cookieid]))
{
echo ("You can not pass login parameters via GET operations.");
exit();
}
}

reset($_REQUEST);





IF (isset($_REQUEST[uid]) AND !isset($_COOKIE[cookieid]))
{
$grabuser = "SELECT recID FROM user WHERE username = '$_REQUEST[uid]' AND password = '$_REQUEST[pwd]'";
$result = @mysql_query($grabuser);
sql_query($result, "$errors[03]");

IF (@mysql_num_rows($result) == 0)
{
error ("$errors[04]");
include ("login_form.php");
exit();
}

ELSE
{
$userid = @mysql_result($result,0,"recID");
$processing_login = true;

$cookie_setter = @setcookie ("cookieid", $userid, time()+$maxlifetime);

IF (!$cookie_setter)
{
error ("$errors[05]");
}

ELSE
{
?>
<META HTTP-EQUIV=Refresh CONTENT="2; URL=index.php">

Please hold one second while we process your login...<br>
If this page does not refresh in 3 seconds, <A HREF="index.php">click here</a>.
<?
exit();
}

}

}


ELSE IF (!isset($_REQUEST[uid]) AND !isset($_COOKIE[cookieid]))
{
include ("login_form.php");
exit();
}



IF ($_REQUEST[action] == "logout")
{
$cookie_setter = @setcookie ("cookieid", $userid, time()-$maxlifetime);

IF (!$cookie_setter)
{
error ("$errors[05]");
}

ELSE
{
?>
<META HTTP-EQUIV=Refresh CONTENT="2; URL=index.php">

Please hold one second while we log you out...<br>
If this page does not refresh in 3 seconds, <A HREF="index.php">click here</a>.

<BR><BR><BR><BR>
<?
exit();
}

}

?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/23573-cookies/#findComment-107017
Share on other sites

so it would look like this?

[code]
<?[u]ob_start()[/u]
include ("config.php");
include ("errors.php");
include ("common.php");
include ("connect.php");


while (list($var, $val) = each ($_REQUEST))
{
IF ($var == "cookieid" AND !isset($_COOKIE[cookieid]))
{
echo ("You can not pass login parameters via GET operations.");
exit();
}
}

reset($_REQUEST);





IF (isset($_REQUEST[uid]) AND !isset($_COOKIE[cookieid]))
{
$grabuser = "SELECT recID FROM user WHERE username = '$_REQUEST[uid]' AND password = '$_REQUEST[pwd]'";
$result = @mysql_query($grabuser);
sql_query($result, "$errors[03]");

IF (@mysql_num_rows($result) == 0)
{
error ("$errors[04]");
include ("login_form.php");
exit();
}

ELSE
{
$userid = @mysql_result($result,0,"recID");
$processing_login = true;

$cookie_setter = @setcookie ("cookieid", $userid, time()+$maxlifetime);

IF (!$cookie_setter)
{
error ("$errors[05]");
}

ELSE
{
?>
<META HTTP-EQUIV=Refresh CONTENT="2; URL=index.php">

Please hold one second while we process your login...<br>
If this page does not refresh in 3 seconds, <A HREF="index.php">click here</a>.
<?
exit();
}

}

}


ELSE IF (!isset($_REQUEST[uid]) AND !isset($_COOKIE[cookieid]))
{
include ("login_form.php");
exit();
}



IF ($_REQUEST[action] == "logout")
{
$cookie_setter = @setcookie ("cookieid", $userid, time()-$maxlifetime);

IF (!$cookie_setter)
{
error ("$errors[05]");
}

ELSE
{
?>
<META HTTP-EQUIV=Refresh CONTENT="2; URL=index.php">

Please hold one second while we log you out...<br>
If this page does not refresh in 3 seconds, <A HREF="index.php">click here</a>.

<BR><BR><BR><BR>
<?
exit();
}

}

?>[/code]can't see your php block?
Link to comment
https://forums.phpfreaks.com/topic/23573-cookies/#findComment-107066
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.