sayedsohail Posted September 29, 2007 Share Posted September 29, 2007 Hi everyone, Is this the right way to extract and store the session variable value? $memid =mysql_real_escape_string($_SESSION['SESS_MID'])); Quote Link to comment https://forums.phpfreaks.com/topic/71196-solved-how-to-store-session-value-in-a-variable/ Share on other sites More sharing options...
Fadion Posted September 29, 2007 Share Posted September 29, 2007 It is the right way. The use of mysql_real_escape_string() makes me think u want to run a query based on the session variable. If so then its ok. Quote Link to comment https://forums.phpfreaks.com/topic/71196-solved-how-to-store-session-value-in-a-variable/#findComment-358112 Share on other sites More sharing options...
KrisNz Posted September 29, 2007 Share Posted September 29, 2007 Well, that particular line won't work since you've got two closing brackets and only one opening one. But yes you can read and write out of the $_SESSION superglobal the same you can $_POST,$_GET etc. I don't see why you would need to see escape the value as you were reading it out of session though. Quote Link to comment https://forums.phpfreaks.com/topic/71196-solved-how-to-store-session-value-in-a-variable/#findComment-358113 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.