Hello, really a bit embarrased by having to blatently ask for help on my code, but here it is...

I just CANT see what's wrong with this code....

<php>

echo("startcount = " . $GET['startcount']);

if (($
POST['newsearch']) || ($_GET['startcount']))
{

echo(" are we in the if?");

}
echo(" or not....");

</php>

Well, when this runs, What I get echoed out is:

startcount = 0 or not....

So, I'm figuring that since the $startcount does exist, we should be getting into the 'if', right? Or is it because the variable is actually set to 0 that php is reading this as 'FALSE'?

Any help would be really appreciated, have been looking at it for ages now!!

    no because starcount = 0 which = FALSE.

    Try

    <?php
    if(array_key_exists('starcount',$_POST) || array_key_exists('starcount',$_GET) ) {
    ...
    }
    ?>

      Thanks for pointing me in the right direction.... actually used

      (isset($_GET['startcount']))

      which has worked a treat.... nice one. thanks for the help!

        Write a Reply...