daveeboi Posted July 17, 2008 Share Posted July 17, 2008 I'm wanting to have an echo statement at the top of a form for my registered site users that will automatically display their usernames so they don't have to enter it. Do I have to use $_SESSION while doing so? Quote Link to comment https://forums.phpfreaks.com/topic/115139-displaying-a-username-on-a-form/ Share on other sites More sharing options...
DeanWhitehouse Posted July 17, 2008 Share Posted July 17, 2008 yes, or cookies Quote Link to comment https://forums.phpfreaks.com/topic/115139-displaying-a-username-on-a-form/#findComment-592091 Share on other sites More sharing options...
daveeboi Posted July 17, 2008 Author Share Posted July 17, 2008 Have been trying echo"Username \"{"$_SESSION['username']}"\n"; But with no luck, any helpful points? Quote Link to comment https://forums.phpfreaks.com/topic/115139-displaying-a-username-on-a-form/#findComment-592096 Share on other sites More sharing options...
sader Posted July 17, 2008 Share Posted July 17, 2008 this example sould work <?PHP session_start(); $_SESSION['username'] = "daveeboi"; echo"Username \"".$_SESSION['username']."\""; ?> Quote Link to comment https://forums.phpfreaks.com/topic/115139-displaying-a-username-on-a-form/#findComment-592109 Share on other sites More sharing options...
Lodius2000 Posted July 17, 2008 Share Posted July 17, 2008 do you mean that they will login and then say go to an order screen and that is where their name will already be filled out or do you want the name to be filled out at the login screen, the 1st case only requires sessions the second you can add cookies to sessions and then it will remember the user Quote Link to comment https://forums.phpfreaks.com/topic/115139-displaying-a-username-on-a-form/#findComment-592146 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.