Jump to content

session prob


fazzfarrell

Recommended Posts

[code][code][code][code]I have created this session:
[code]
<?php
session_start();
$MM_Username = $HTTP_POST_VARS['Username'];
$_SESSION["MM_Username"] = $MM_Username;
?>[/code]

that comes from
[code]
<form id="Username" name="Username" method="POST" action="<?php echo $loginFormAction; ?>">
            <table width="296" border="0" class="copy">
              <tr>
                <td width="139">Username (Your Email) : </td>
                <td width="147"><label>
                  <input name="Username" type="text" id="Username" />
                </label></td>
              </tr>
              <tr>
                <td>Password:</td>
                <td><label>
                  <input name="Password" type="text" id="Password" />
                </label></td>
              </tr>
              <tr>
                <td><label>
                  <input name="Submit" type="submit" class="clickhere" value="Log in" />
                </label></td>
                <td>&nbsp;</td>
              </tr>
            </table>
            </form>[/code]

But I cant get the session to work am i missing something?[/code][/code][/code][/code]
Link to comment
https://forums.phpfreaks.com/topic/26680-session-prob/
Share on other sites

[b]Page 1[/b]
[code]<?php
session_start();
if(isset($_POST['Submit']))
{
  $_SESSION["MM_Username"] =  $HTTP_POST_VARS['Username'];
}
?>

<form id="Username" name="Username" method="POST" action="<?php echo $loginFormAction; ?>">
            <table width="296" border="0" class="copy">
              <tr>
                <td width="139">Username (Your Email) : </td>
                <td width="147"><label>
                  <input name="Username" type="text" id="Username" />
                </label></td>
              </tr>
              <tr>
                <td>Password:</td>
                <td><label>
                  <input name="Password" type="text" id="Password" />
                </label></td>
              </tr>
              <tr>
                <td><label>
                  <input name="Submit" type="submit" class="clickhere" value="Log in" />
                </label></td>
                <td>&nbsp;</td>
              </tr>
            </table>
            </form>[/code]

[b]Page 2[/b]
[code]<?php
session_start();
echo $_SESSION['MM_Username'];
?>[/code]

Orio.
Link to comment
https://forums.phpfreaks.com/topic/26680-session-prob/#findComment-122062
Share on other sites

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.