February 22, 201115 yr so i call the session variable as stated in my script above. but in my login scripts i need to make sure the variable is available? Cheers for this. Exactly. Perhaps look at some tutorials about how to display all the session variables you have stored and display them on every page in development so you can see at a glance what you've got. i can spell however i wanna spell, if u don't like it tough , noobs just don't like to hear the hard truth See what I mean Craigpettit? This is the kind of attitude I'm talking about. "noobs just don't like to hear the hard truth" - what a crock. "Noobs" need to learn. Just like you once did webdesigner93. In fact your post here webdesigner93 sounds like you're throwing your toys out of the pram a bit. Let me raise a point - part of being a good developer is to be able to explain simply and kindly to someone less knowledgable or advanced as you how to do something. Hence the word "development". We're all in this together. If you can't gently and clearly explain to a "noob" how to do something then you might want to question your own understanding. Being a good teacher and having a good attitude is a strong sign of your own ability. Think about that for a moment.
February 22, 201115 yr and actually theres a better way to do this, that is using the users id such as $sql = mysql_query("SELECT * FROM users WHERE id = '".$_SESSION['id']."'"); better yet u can create a function to pull this info function user_data($data){ $sql = mysql_query("SELECT * FROM users WHERE id = '".$_SESSION['id']."'"); $pull = mysql_fetch_array($sql) or die (mysql_error()); return $pull[$data]; } then u can use the function like so echo user_info('email'); //Or echo user_info('firstname'); ect.. not tested yet should work so see no need to store the users email lol, i dont know of any login system that does that better to store the users unique id, and pull data as needed using a user created function Yes, although Craigpettit - you might want to change "echo user_info" to "echo user_data" since the name of the function is actually "user_data" not "user_info". Nice to see you now helping the guy out in a patient and understanding way webdesigner93 . Edited February 22, 201115 yr by Beeble
February 22, 201115 yr Exactly. Perhaps look at some tutorials about how to display all the session variables you have stored and display them on every page in development so you can see at a glance what you've got. See what I mean Craigpettit? This is the kind of attitude I'm talking about. "noobs just don't like to hear the hard truth" - what a crock. "Noobs" need to learn. Just like you once did webdesigner93. In fact your post here webdesigner93 sounds like you're throwing your toys out of the pram a bit. Let me raise a point - part of being a good developer is to be able to explain simply and kindly to someone less knowledgable or advanced as you how to do something. Hence the word "development". We're all in this together. If you can't gently and clearly explain to a "noob" how to do something then you might want to question your own understanding. Being a good teacher and having a good attitude is a strong sign of your own ability. Think about that for a moment. I tried to be clear by telling him theres no reason to store an email within a session, this stuff can be pulled directly from mysql using a user created function as i so kindly showed above.
February 22, 201115 yr Yes, although Craigpettit - you might want to change "echo user_info" to "echo user_data" since the name of the function is actually "user_data" not "user_info". yea i type fast sometimes, im sure he could have figured it out
February 22, 201115 yr I tried to be clear by telling him theres no reason to store an email within a session, this stuff can be pulled directly from mysql using a user created function as i so kindly showed above. I totally agree, although 6 of one, half a dozen of the other I guess, here's now two ways you can practise Cragpettit and get to grips with two methods rather than one. See which one you prefer.
February 22, 201115 yr I totally agree, although 6 of one, half a dozen of the other I guess, here's now two ways you can practise Cragpettit and get to grips with two methods rather than one. See which one you prefer. See, i still have some nice in me but ether way i will demand respect rather he wants to give it to me or not, after all he first call rallport an idiot, so if any noob or otherwise feels the need to challenged, me i'll lay it on very thick and not lose any sleep over it, in the end i worked hard to get where i am at so people may say what they may say Edited February 22, 201115 yr by webdesigner93
February 22, 201115 yr See, i still have some nice in me but ether way i will demand respect rather he wants to give it to me or not, after all he first call rallport an idiot, so if any noob or otherwise feels the need to challenged, me i'll lay it on very thick and not lose any sleep over it, in the end i worked hard to get where i am at so people may say what they may say Come on though, rallport WAS an idiot, that's why Craigpettit responded in the way he did. And respect has to be earned not demanded, you know that. I've no doubt you worked hard to get where you are, and am pleased for you, this is an uphill struggle. There's no need to "lay it on very thick" at all - I see nothing wrong with what Craigpettit has posted here. He's just struggling with a concept which'll no doubt suddenly click, and although I don't doubt your advanced abilities, I'm sure that you still come across (albeit more complex) problems than this which have the same effect on you. No? Someone hasn't had enough coffee today, methinks!
February 22, 201115 yr Come on though, rallport WAS an idiot, that's why Craigpettit responded in the way he did. And respect has to be earned not demanded, you know that. I've no doubt you worked hard to get where you are, and am pleased for you, this is an uphill struggle. There's no need to "lay it on very thick" at all - I see nothing wrong with what Craigpettit has posted here. He's just struggling with a concept which'll no doubt suddenly click, and although I don't doubt your advanced abilities, I'm sure that you still come across (albeit more complex) problems than this which have the same effect on you. No? Someone hasn't had enough coffee today, methinks! Nah more like to much coffee i need decaf, and in rallports defence some people do come on here and try to pass scripts off as there own Edited February 22, 201115 yr by webdesigner93
February 22, 201115 yr Author Nah more like to much coffee i need decaf, and in rallports defence some people do come on here and try to pass scripts off as there own this is my script.
February 22, 201115 yr this is my script. never said it was not, but as a piece of advice to avoid those notices u should write ur post variables like this $name = (isset($_POST['name'])) ? $_POST['name'] : false; This should get rid of any undefined index errors when error_reporting is on, u can do the same for the sessions $email = (isset($_SESSION['email'])) ? $_SESSION['email'] : false; Edited February 22, 201115 yr by webdesigner93
Create an account or sign in to comment