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
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)
Link to comment
Share on other sites

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().
Link to comment
Share on other sites

using the auto start would be a bad idea if part of your is not part of a session, right? Part of the site takes cc#'s and phyical address and email addresses and the part of the site that is not part of the session is not secure. What is your opinion?
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.