Jump to content

using SESSION and after header redirect SESSION is gone


loren646

Recommended Posts

update.php

<?php

session_start();

$_SESSION['owner']=$_POST['ownert'];

$owner=$_SESSION['owner'];

 

[/i]

 

SUBMIT button goes to updateprocess.php

 

?>

 

[u]updateprocess.php[/u]

<?php

header('Location: http://www.website.com/update.php');

 

[i][code][/i]

 

?>

 

i read online and tried putting session_start(); on updateprocess.php but that doesn't seem to work either.

$_POST['ownert'];

 

ownert??

 

Edit: and actually you said when you submit it goes straight to the other page. So your code to put the variables IN the session won't ever work.

 

sorry, i couldn't edit. owner"T" is just a typo here and not in the actual program.

 

This code is the the 2nd page. the first page is an html with a submit button.

 

$_SESSION['owner']=$_POST['owner'];

 

now that we have $_SESSION['owner'] i can echo it and it displays. Now i have to process information on this page (update.php). and it processes it on the next page (updateprocess.php) and redirects back to update.php. Now update.php does NOT have $_SESSION['owner'].

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.