Jump to content

redirecting user to page viewed last after sign up... trouble passing variable


phpchick

Recommended Posts

so the user is reading a story, to finish reading he has to click a link that redirects them to the signup page.

<?php
session_start();
$beginurl = $_SERVER['HTTP_REFERER'];
$_SESSION['beginurl'] = $beginurl;
echo $_SESSION['beginurl'];
?>
<html>
<head>
  </head>
<body>
<script type="text/javascript"><!--
location.replace("http://www.mysite.com/members/");
//--></script>
  </body>
</html>

 

When they get to the second page, they have to click a link that opens up a modal. this is the code that runs when they hit the register button

 

			session_start();
		$beginurl = $_SESSION['beginurl'];

		$beginurl= (isset($_SESSION['beginurl'])) ? $_SESSION['beginurl'] : 'Error';

	if( $_SESSION['status'] ='authorized')   
		$_SESSION['$makemodal'] = 0;

//sends the user to the page upon successful password credential
	if(!isset($_SESSION['SESS_USERID'])||(trim($_SESSION['SESS_USERID']=='admin'))) 
   { 
        echo '<script language="javascript">'; 
         
echo "top.location.href = $beginurl"; 
        echo '</script>'; 
        exit(); 
    } 

 

 

Am I passing this variable correctly?

 

and I'm not sure if the top.location.href towards the bottom is correct either, right now after I hit the register button I'm redirected to a blank page where the url is,

 

"http://www.mysite.com/function Error() { [native code]}"

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.