fazzfarrell Posted November 9, 2006 Share Posted November 9, 2006 [code][code][code][code]I have created this session:[code]<?phpsession_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> </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 More sharing options...
Orio Posted November 9, 2006 Share Posted November 9, 2006 [quote author=fazzfarrell link=topic=114379.msg465371#msg465371 date=1163070050]But I cant get the session to work am i missing something?[/quote]What do you mean by "I cant get the session to work"?Orio. Link to comment https://forums.phpfreaks.com/topic/26680-session-prob/#findComment-122045 Share on other sites More sharing options...
fazzfarrell Posted November 9, 2006 Author Share Posted November 9, 2006 I have put[code]<?php echo $_SESSION['MM_Username']; ?>[code]on the second page along with the session script at the top of the page but nothing appears[/code][/code] Link to comment https://forums.phpfreaks.com/topic/26680-session-prob/#findComment-122053 Share on other sites More sharing options...
Orio Posted November 9, 2006 Share Posted November 9, 2006 [b]Page 1[/b][code]<?phpsession_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> </td> </tr> </table> </form>[/code][b]Page 2[/b][code]<?phpsession_start();echo $_SESSION['MM_Username'];?>[/code]Orio. Link to comment https://forums.phpfreaks.com/topic/26680-session-prob/#findComment-122062 Share on other sites More sharing options...
fazzfarrell Posted November 9, 2006 Author Share Posted November 9, 2006 gret thanks Link to comment https://forums.phpfreaks.com/topic/26680-session-prob/#findComment-122065 Share on other sites More sharing options...
Orio Posted November 9, 2006 Share Posted November 9, 2006 Remember- if you want to use the $_SESSION variables, you gotta call session_start() :)Orio. Link to comment https://forums.phpfreaks.com/topic/26680-session-prob/#findComment-122067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.