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? Quote 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']; Quote 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? Quote 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) Quote 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? Quote 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. Quote 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 Quote 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. Quote 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 Quote 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! Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/117870-solved-echo-help/#findComment-606306 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.