[FX.php List] Annoying PHP warning

Gjermund Gusland Thorsen ggt667 at gmail.com
Sun Sep 7 15:21:02 MDT 2008


You should really not turn globals on.

This is good
---
if (isset($_GET['skipSize'])){
       $skipSize=$_GET['skipSize'];
}
---

The point with globals on is that you can make

---
if( isset( $skipSize ) ) {
       $mySkipSize = $skipSize;
}
---

but it is not good practice.

ggt

2008/9/7 Bob Patin <bob at patin.com>:
> Well, it's a LOT of code; it's a very complex form, with a large loop that
> takes an array and processes the array elements, does some calculations, and
> then generates a table. At the top of the form, where the error is (because
> I can comment it out and eliminate it), the code there is probably 30-40
> lines long.
>
> But here's just one place where I'm using a GET_var and also using it as a
> variable:
>
> if (isset($_GET['skipSize'])){
>        $skipSize=$_GET['skipSize'];
> }
>
> So if I understand correctly, I shouldn't use the same var name in 2 places
> like that?
>
> I've done it a million times with POST variables; I know that I always try
> to keep my var names the same as field names, for consistency...
>
> BP
>
> --
> Bob Patin
> Longterm Solutions
> bob at longtermsolutions.com
> 615-333-6858
> http://www.longtermsolutions.com
> iChat: bobpatin
> AIM: longterm1954
> FileMaker 9 Certified Developer
> Member of FileMaker Business Alliance and FileMaker TechNet
> --------------------------
> FileMaker hosting and consulting for all versions of FileMaker
> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>
>
>
> On Sep 7, 2008, at 12:45 PM, Leo R. Lundgren wrote:
>
>> Well, I don't really know for sure. I haven't encountered that error
>> myself and therefore haven't fixed it either.
>>
>> So, you're saying that you have a "yes" to #2, but not #1 (in the cases of
>> #2), when you encountered the same error?
>>
>> I'm merely trying to see what could be the cause, but I don't know
>> anything yet :-)
>>
>> Bob; Is it possible to see the code that might be causing this error?
>>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>


More information about the FX.php_List mailing list