Jump to content

[SOLVED] Carry post info to a registration page


tqla

Recommended Posts

Hello.

 

I have a link that links to a file. One can click on that link and see the file but only if they are logged in. If they are not logged in they are redirected to a login page. Once they successfully log in they are automatically taken to the file. This works fine.

 

This is what's in the address bar during this process, it automatically shows the folder and php page where the file is located:

 

http://ufjfurjtrigj.com/resource_center/insight/MRLlogin.php?accesscheck=%2Fresource_center%2Fpdfs%2FTechnology_Adoption.php

 

On this same login page I have a link to a signup page that they can use if they don't already have a username and password.

 

What I want to do is carry the same URL to the registration page, or in other words, register the "accesscheck" variable so that after they successfully register they will automatically be taken to the file too.

 

How can I register this variable when the user clicks on the signup page link?

 

After I register the variable I will use

header("Location: " . $accesscheck);   

to get to the page. (I think)

 

Ya know what I mean? Thanks.

 

Thanks p2grace. That's what I thought. How do you do that? How do I carry and save the "accesscheck" variable in this URL to the new page?

 

http://ufjfurjtrigj.com/resource_center/insight/MRLlogin.php?accesscheck=%2Fresource_center%2Fpdfs%2FTechnology_Adoption.php

<?php

  session_start();
  if (isset($_POST['accesscheck'])) {
    $_SESSION['accesscheck'] = $_POST['accesscheck'];
    header('Location: http://site.com/somepage.php');
  }

?>

 

Then, on somepage.php

<?php

  session_start();
  if (isset($_SESSION['accesscheck'])) {
    $accesscheck = $_SESSION['accesscheck'];
  }

?>

 

Is that what you meen?

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.