Jump to content

Post And Session Varaibles


jpratt

Recommended Posts

[img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /] I am unable to get values from two login fields into session variables. The following code is not putting the values from my text fields into my session variables:

<?
if(isset($_POST['SID']) && isset($_POST['EID']))
{
$_SESSION['SID']=$_POST['SID'];
$_SESSION['EID']=$_POST['EID'];
header("Location: owner/main.php");
}
?>
.
.
.
.
.
<form name="login" method="post" action="login.php">
<input name="SID" type="text" class="inputbox" size="50" maxlength="50">
<input name="EID" type="text" class="inputbox" id="EID" size="50" maxlength="60">
<input name="Submit" type="submit" class="btn" value="Login">
</form>

Any ideas? Please help!!!
Link to comment
https://forums.phpfreaks.com/topic/13039-post-and-session-varaibles/
Share on other sites

[!--quoteo(post=388578:date=Jun 27 2006, 06:44 PM:name=justinphp)--][div class=\'quotetop\']QUOTE(justinphp @ Jun 27 2006, 06:44 PM) [snapback]388578[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Do I need anything at the beginning of the next page to reference these variables?
[/quote]

just session_start();

personally I would create friendly variables on the new page like:

$eid = $_SESSION['EID'];
$sid = $_SESSION['SID'];

(usually at the beginning)
You saying that this is a previous script from someone and that they didn't have session_start at the top of their pages? If thats the case then they most probably had setting called [b]session.auto_start[/i] enabled.

This setting starts the session on every page request without having to use session_start().

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.