ngreenwood6 Posted August 2, 2008 Share Posted August 2, 2008 Hello I am using a login script from (http://phpeasystep.com/workshopview.php?id=6). On my main page I have used the login form, but when a users is logged in I want it to display ("you are logged in as 'username'") I have used this: if(session_is_registered('myusername')) { echo "You are logged in as "; echo ($myusername); echo "!".'<br />'; echo "<a href='logout.php'>Click here</a> to log out!"; on my local server it is working perfectly (using wamp), displaying the username. however when i uploaded it for testing, it does not display the username. am i missing something or should it be coded different? Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/ Share on other sites More sharing options...
Stooney Posted August 2, 2008 Share Posted August 2, 2008 Try this: echo $_SESSION['myusername']; Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606269 Share on other sites More sharing options...
ngreenwood6 Posted August 2, 2008 Author Share Posted August 2, 2008 I tried doing what you had suggested and I got the same thing. Works locally on my wamp but on the server it is the same affect does not display the username. any other suggestions? Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606270 Share on other sites More sharing options...
Stooney Posted August 2, 2008 Share Posted August 2, 2008 Does the server support sessions? (I may be wrong but I believe some free hosts don't allow them) Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606271 Share on other sites More sharing options...
AdRock Posted August 2, 2008 Share Posted August 2, 2008 Have you used session_start() at the top of your page? Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606272 Share on other sites More sharing options...
ngreenwood6 Posted August 2, 2008 Author Share Posted August 2, 2008 actually i tried this on the free server that i use for testing as well and it worked but on my paid server through godaddy it is not working. i think that sessions is disabled. anyone know how to enable them in godaddy. Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606275 Share on other sites More sharing options...
LemonInflux Posted August 2, 2008 Share Posted August 2, 2008 People still actually use goDaddy? ---------------- Now playing: Get Cape. Wear Cape. Fly - Find The Time via FoxyTunes Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606277 Share on other sites More sharing options...
Stooney Posted August 2, 2008 Share Posted August 2, 2008 People still actually use goDaddy? ---------------- Now playing: Get Cape. Wear Cape. Fly - Find The Time via FoxyTunes People still use windows 98. It happens. Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606278 Share on other sites More sharing options...
LemonInflux Posted August 2, 2008 Share Posted August 2, 2008 No way ---------------- Now playing: Get Cape. Wear Cape. Fly - Find The Time via FoxyTunes Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606279 Share on other sites More sharing options...
ngreenwood6 Posted August 2, 2008 Author Share Posted August 2, 2008 who would you suggest as a web hosting company any and all suggestions are welcome! Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606302 Share on other sites More sharing options...
Stooney Posted August 2, 2008 Share Posted August 2, 2008 who would you suggest as a web hosting company any and all suggestions are welcome! Personally, 1and1.com But here's the thread about web hosts: http://www.phpfreaks.com/forums/index.php/topic,117475.0.html Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606306 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.