Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 hevan

hevan
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 30 October 2006 - 06:37 PM

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.c...tpassword.php">[<font color="#FFFFFF">Forgot Password?</font>]</a> <a href="http://www.zoom-in.c.../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.

#2 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 30 October 2006 - 10:18 PM

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
header("Location: http://www.article.com");
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!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users