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.
Link to comment
Share on other sites

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!
Link to comment
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.