Jump to content

After successful login, previous page won't load (something else opens) HELP


hevan

Recommended Posts

Hi there.

Here is my problem: you click on a link to view an article, it takes you to a register/login page. After a successful login/registration, you are supposed to go to that particular article. Instead, you are taken somewhere else (i.e. the wrong page). Here is my code for the login page:

<div style="width:350px;" align="center">
<form id="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" method="post">
<div id="memberForm" align="left">
<?php
if(isset($_SESSION["Authenticated"]))
{
?>
Welcome <b><?php echo $_SESSION["FirstName"] . " " . $_SESSION["LastName"]; ?></b>, <u>[ <a href="?logout=true" class="form">Sign out</a> ]</u>
<?php
}
else
{
?>
<div align="center">Email:
<?php
if(isset($_COOKIE['Email']))
{
if($_COOKIE['Email'] == true)
{
$Checked = "CHECKED";
}
}
?>
<input name="EmailAddress" type="text" value="<?php if(isset($_COOKIE['Email'])) echo $_COOKIE['Email']; ?>" size="10" />
Password:
<input name="UserPassword" type="password" value="<?php if(isset($_COOKIE['Password'])) echo $_COOKIE['Password']; ?>" size="10" />
<font color="#FFFFFF"><a href="javascript:document.forms[0].submit();">[<font color="#FFFFFF">Go</font>]</a></font><br />
<font color="#FFFFFF">
<a href="javascript:document.forms[0].submit();"></a> <a href="http://www.zoom-in.com/forgotpassword.php">[<font color="#FFFFFF">Forgot Password?</font>]</a> <a href="http://www.zoom-in.com/register.php"></a></font><font color="#FFFFFF">
<input type="checkbox" name="remember" value="true" <?php if(isset($Checked)) echo $Checked; ?> />
Remember me </font></div>
<?php
}
?>

<?php
if($Login == "failed")
{
echo "<br>The email address or password entered is incorrect.";
}
?>
</div>
<?php
if(isset($_GET["redir"]))
{
?>
<div><input type="hidden" name="Refer" value="<?php if(isset($_SESSION['prevurl'])) { echo 'http://' . $_SERVER['SERVER_NAME'] . '/' . $_SESSION['prevurl']; } ?>" /></div>
<?php
}
else
{
?>
<div><input type="hidden" name="Refer" value="http://<?php echo $_SERVER['SERVER_NAME']; ?>" /></div>
<?php
}
?>
<div><input type="hidden" name="Authenticate" value="1" />
</form>
</div>

Any help is appreciate. Thanks.
i dont reallly understand what you're doing with that script lol but.. what i do know is once the visitor clicks on view article or whatever that was and goes through the user check process you can use
[code]header("Location: http://www.article.com");[/code] exept replace the url to the page that the article is on for the visitor to see.. i dont know exactly what you're looking for but let me know what else you're having problem with and i will do my best to help you! good luck!

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.