Page 1 of 1

passing username var to the next page using sessions

Posted: Mon Dec 08, 2003 1:52 pm
by malcolmboston
ok, this is gonna sound so n00by

basically i have this on logged_in/index.php
this is used for showing the variable

Code: Select all

<?php 
echo $_POST['username'];
echo $_POST['password'];
?>
and i have this on the page before,the login page,

Code: Select all

&lt;form action="" method="post" name="login_form" id="login_form"&gt;
username
&lt;input name="username" type="text" id="username"&gt;
&lt;br&gt;
password
&lt;input name="password" type="password" id="password"&gt;
&lt;br&gt;
&lt;input name="submit_button" type="submit" id="submit_button" value="login"&gt;
&lt;/form&gt;
now whatever happens it will not pass teh variable and just leaves a blank space where it shouold be, when i turn register_globals on, it works after amending the code, but i want it designed so that it works when its turned off, can anyone explain why it isnt working

please note : i have no other code on the login page, in case you need something that defines what to pass which i dont thinbk is the case.

currently i use cookies and it works properly but i need to use sessions to do it because i need to display some more info from there session and dont want to set cookies for no reason

Thanks

Posted: Mon Dec 08, 2003 3:30 pm
by qads

Code: Select all

<?php
echo $_HTTTP_POST_VARS['username']; 
echo $_HTTP_POST_VARS['password']; 
?>
try this, if this works then you have the older version of php, i suggest you update it.