Roach Posted February 9, 2007 Share Posted February 9, 2007 Hi again, So I finaly got by script storing data to config (earlier post) now I need that info in a paypal script. I have tried opening the database from within the script to get stored info however I get all kinds of fgets and fclose errors, presumably because its trying to get the info from paypal ? I gave up on that so now am playing with "if (isset" with: global $my_config; if (isset($this_item['t'])) { do this thing} if (isset($this_item[' '])) { do other thing} after looking at function if (isset around the web I am getting the fealing that it is used more for posted information and not stored info ? Any help appreciated. Rochelle Quote Link to comment Share on other sites More sharing options...
only one Posted February 9, 2007 Share Posted February 9, 2007 yea isset is for posting stuff, just use an if with your variable doing what ever you want, its very simple Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 isset is for checking if any variable is set. What is the actual problem here? Quote Link to comment Share on other sites More sharing options...
Roach Posted February 9, 2007 Author Share Posted February 9, 2007 yea isset is for posting stuff, just use an if with your variable doing what ever you want, its very simple Am I correct is thinking this is what you mean ? global $my_config; if ($this_item['t']) { do this thing} if ($this_item[' ']) { do other thing} When you say just use if statement? Quote Link to comment Share on other sites More sharing options...
Roach Posted February 9, 2007 Author Share Posted February 9, 2007 isset is for checking if any variable is set. What is the actual problem here? I am just working within a basic paypal ipn script but I need it to check a field from my config and if field = 't' do this db insert and if field = ' ' <empty do another insert Rochelle Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 You can use that, but if the variable isn't set, it will produce notices when error reporting is set to show notices. It's considered poor practice - it's a bad habit I have and I am still learning how to avoid notices. We'd need to see more of the code to tell if it really is needed here. isset() will return true if the variable is set - but if the variable is FALSE, isset will return true. Just an if() will return false if the variable is false or not set or = 0, etc. Quote Link to comment Share on other sites More sharing options...
Roach Posted February 9, 2007 Author Share Posted February 9, 2007 update for anyone who stumbles across this in the future: the code I finally used was: global $my_config; if($this_item !== 't' ){ do this thing} if($this_item !== 'f' ){do another thing} Works for me.... Regards Quote Link to comment 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.