bleured27 Posted July 15, 2012 Share Posted July 15, 2012 i got a session whith username in it i want to get the valeu in it in a normal variable string $username=$_SESSION['myusername']; wont WORK PLZ HELP Link to comment https://forums.phpfreaks.com/topic/265712-sessions/ Share on other sites More sharing options...
Pikachu2000 Posted July 15, 2012 Share Posted July 15, 2012 The code you're using is outdated. I recognize the code as being from phpeasystep, and as has already been pointed out in anther thread you participated in, it makes use of deprecated functions. You need to stop using code and examples from that site. You also need to turn on error reporting, and leave it on while developing. In your php.ini file: error_reporting = -1 display_errors = On Then restart Apache and you should start seeing any errors your code may generate. Link to comment https://forums.phpfreaks.com/topic/265712-sessions/#findComment-1361703 Share on other sites More sharing options...
bleured27 Posted July 15, 2012 Author Share Posted July 15, 2012 where i can turn it on i use xampp and how to do it whit error report on? Link to comment https://forums.phpfreaks.com/topic/265712-sessions/#findComment-1361704 Share on other sites More sharing options...
bleured27 Posted July 15, 2012 Author Share Posted July 15, 2012 than where i can find a good login and register script + secured pages help Link to comment https://forums.phpfreaks.com/topic/265712-sessions/#findComment-1361707 Share on other sites More sharing options...
bleured27 Posted July 15, 2012 Author Share Posted July 15, 2012 got new script can u help me now i need session as string variable <?php session_start(); if(!session_is_registered("userName")) { header("location:login_form.php"); } else { echo '<h2>Successfully Login <br /> Welcome '.$userName.'</h2>'; echo '<a href="logout.php"> Log Out</a>'; } ?> Link to comment https://forums.phpfreaks.com/topic/265712-sessions/#findComment-1361720 Share on other sites More sharing options...
Pikachu2000 Posted July 15, 2012 Share Posted July 15, 2012 Read this PHP manual entry before you go any farther: session_is_registered. Link to comment https://forums.phpfreaks.com/topic/265712-sessions/#findComment-1361723 Share on other sites More sharing options...
bleured27 Posted July 16, 2012 Author Share Posted July 16, 2012 my session is registered i read it ,still (im dutch) i dont quite undertand it iread a dutch guide and there stood only register distroy and no action to set the sessions string into a variable i have my session registered and it's worKing fine in that way only i can't echo it and can't maKe it a variable (string) ps my little K isn't worKing sorry for that Link to comment https://forums.phpfreaks.com/topic/265712-sessions/#findComment-1361833 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.