hard question to ask, but probably simple to answer
Posted: Tue Jun 02, 2009 3:43 am
Ok I've been having a hard time trying to search for a solution to this on the internet, I'm hoping somebody with experience could lend a few moments to help with this...
I'm passing variables between pages with forms using GET method, and to make it simpler let's say for instance I have a variable called NUMBER, and I want to run code if a NUMBER is being passed.. Sounds simple, and I thought this would work...
and it does work.. except when NUMBER = 0.. which is my problem because 0 is passed just as often as any other number..
this is my solution in the meantime.. i've set up a dummy variable NUMTRUE on the posted form and then I'm doing this...
that way when NUMBER=0, it will be treated like any other number, but that seems inefficient to me.. is there a better way to do this?
I'm passing variables between pages with forms using GET method, and to make it simpler let's say for instance I have a variable called NUMBER, and I want to run code if a NUMBER is being passed.. Sounds simple, and I thought this would work...
Code: Select all
$mynum = $_GET['NUMBER'];
if ($mynum) {
...main code
}
this is my solution in the meantime.. i've set up a dummy variable NUMTRUE on the posted form and then I'm doing this...
Code: Select all
if ($_GET['NUMTRUE']) {
...main code
}