ohdang888 Posted March 3, 2008 Share Posted March 3, 2008 ok i'm having a problem with this.... the page is "edit_settings.php?source=1" this is where the problem is: function sql_quote($data) { if (get_magic_quotes_gpc()) { $data = stripslashes($data); } return addslashes($data); } $id = $_SESSION['id']; $new = sql_quote($GET['source']); if ($new == 1){ echo 'You have successfully reigstered!'; echo '<br>'; echo '<font size=6>'; echo 'IMPORTANT: Please take a moment to review your profile settings.'; } but the "you have registersed" and "take a moment" is not showing up at all. whats wrong? Any help is greatly appreciated! thanks. Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/ Share on other sites More sharing options...
me1000 Posted March 3, 2008 Share Posted March 3, 2008 if ($new == "1"){ try that... Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/#findComment-482049 Share on other sites More sharing options...
teng84 Posted March 3, 2008 Share Posted March 3, 2008 echo $new ; to see why! Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/#findComment-482051 Share on other sites More sharing options...
teng84 Posted March 3, 2008 Share Posted March 3, 2008 if ($new == "1"){ try that... $new==1 and $new=="1" is the same not unless you do this 1==='1' so it will give you false Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/#findComment-482053 Share on other sites More sharing options...
ohdang888 Posted March 3, 2008 Author Share Posted March 3, 2008 when i echo $new, nothing comes up, so "1" isn't even stored in it. what wrong with my the grabbing part of my code then? Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/#findComment-482054 Share on other sites More sharing options...
teng84 Posted March 3, 2008 Share Posted March 3, 2008 no return value function sql_quote($data) { if (get_magic_quotes_gpc()) { $data = stripslashes($data); } should be function sql_quote($data) { if (get_magic_quotes_gpc()) { $data = stripslashes($data); return $data ; } Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/#findComment-482067 Share on other sites More sharing options...
ohdang888 Posted March 3, 2008 Author Share Posted March 3, 2008 its still not working. but what does return data mean? Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/#findComment-482071 Share on other sites More sharing options...
teng84 Posted March 3, 2008 Share Posted March 3, 2008 your calling the function right so if its not returning any value then your variable not be set because the function does nothing do you have a value for this $GET['source'] tho echo that and ill try to fix your logic Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/#findComment-482075 Share on other sites More sharing options...
ohdang888 Posted March 3, 2008 Author Share Posted March 3, 2008 echo $GET['source']; that is also doing nothing, it must be higher up. Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/#findComment-482081 Share on other sites More sharing options...
teng84 Posted March 3, 2008 Share Posted March 3, 2008 echo $GET['source']; that is also doing nothing, it must be higher up. is that really $GET['source']; and not $_GET['source']; ??? once you manage to get the value of the $_GET add the code i gave you and you'll be fine Link to comment https://forums.phpfreaks.com/topic/94103-if-statement/#findComment-482088 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.