Re: PHP problem


Subject: Re: PHP problem
From: Joshua Walton (joshua@conflux.org)
Date: Thu Oct 10 2002 - 14:43:18 AKDT


Hi,

Here are a few ideas...
You can use gettype($var_name) to determine the type
(more info at http://www.php.net/manual/en/function.gettype.php )

You can use this simple function call at the end of a page to help
determine exactly what is getting passed to the page
function debugPage() {
         echo "<br><br>Page Information</br>";
         echo "<pre>";
         echo "---------------POST VARS--------------- \n";
         print_r($_POST);
         echo "---------------GET VARS--------------- \n";
         print_r($_GET);
         echo "---------------COOKIES--------------- \n";
         print_r($_COOKIE);
         echo "---------------SESSIONS--------------- \n";
         print_r($_SESSION);
         echo "---------------GLOBALS---------------- \n";
         print_r($GLOBALS);
         echo "---------------SERVER INFO--------------- \n";
         print_r($_SERVER);
         echo "---------------FILES--------------- \n";
         print_r($_FILES);
         echo "---------------ENVIRONMENT--------------- \n";
         print_r($_ENV);
         echo "---------------REQUESTS--------------- \n";
         print_r($_REQUEST);
}

I would be happy to take a look at the script. Hope some of this helps.

best,
joshua

On Thursday, October 10, 2002, at 05:25 PM, Mike Barsalou wrote:

> From: Mike Barsalou <mbarsalou@aidea.org>
> Date: Thu Oct 10, 2002 5:25:51 PM US/Central
> To: "'Leif Sawyer'" <lsawyer@gci.com>, "'aklug@aklug.org'"
> <aklug@aklug.org>
> Subject: RE: PHP problem
>
>
> Is there a way to find out what each of those variables are currently
> typed
> as? That might shed some light as well.
>
> Thanks for the help.
>
> Mike
>
> -----Original Message-----
> From: Leif Sawyer [mailto:lsawyer@gci.com]
> Sent: Thursday, October 10, 2002 1:57 PM
> To: Mike Barsalou; 'aklug@aklug.org'
> Subject: RE: PHP problem
>
>
> Mike Barsalou writes:
>> if ($output == $value)
>> [...]
>>
>> Produces this:
>>
>> Output:217: Value:217:
>> The values are not equal
>
>
> Make sure that you're comparing integer to integer, and not
> string to integer..
>
> if ( (string)$output == (string)$value )
> or
> if ( (int)$output == (int)$value )
>
>
>
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Thu Oct 10 2002 - 14:39:51 AKDT