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]}"

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.