[FX.php List] Thoughts about line 1425 of FX.php
Steve Winter
steve at bluecrocodile.co.nz
Wed Jun 10 15:49:45 MDT 2009
Hi Dale,
As per the original post, I get it whenever I submit an array through
the post variable... so if my form has something like
<input type="text" name="box[]" value="car" />
<input type="text" name="box[]" value="truck" />
<input type="text" name="box[]" value="bus" />
<input type="text" name="box[]" value="plane" />
<input type="text" name="box[]" value="helicopter" />
When the data arrives back at PHP I have an array in the POST variable
called box, which has as it's values car, truck etc...
Cheers
Steve
On 10 Jun 2009, at 22:33, Dale Bengston wrote:
> Steve,
>
> When did you get a warning like this? What triggered it? Or could
> you ever figure out why?
>
> Dale
>
> On Jun 10, 2009, at 2:34 PM, Steve Winter wrote:
>
>> Partially answering my own question, but not wanting to stifle the
>> raging debate ;-) I turned line 1425 into;
>>
>> if(is_array($value)) {
>> foreach($value as $partKey => $partValue) {
>> $tempQueryString .=
>> urlencode($key) . .urlencode('['.$partKey.']').'=' .
>> urlencode($partValue) . '&';
>> }
>> } else {
>> $tempQueryString .= urlencode($key) . '=' .
>> urlencode($value) . '&';
>> }
>>
>> which seems to make the error go away (which is always nice ;-).
>> Anyone see any issues with this...?
>>
>> Cheers
>> Steve
>>
>>
>> On 10 Jun 2009, at 18:13, Steve Winter wrote:
>>
>>> Hi all,
>>>
>>> Not sure if anyone's ever seen this wee error;
>>> Warning: urlencode() expects parameter 1 to be string, array
>>> given in /path/to/fx/FX.php on line 1425
>>> but I periodically get it, and today I decided to try and find out
>>> why...
>>>
>>> Turns out that the function it's part of BuildLinkQueryString ()
>>> is taking the posted parameters and attempting to create a nice
>>> URL friendly string...
>>>
>>> Nice idea and all that, and maybe I'm the only one who ever does
>>> it, but I periodically push form data into an array, and it's that
>>> which is causing the issue...
>>>
>>> So, does anyone know how important (or not) that function is to
>>> the internal workings of FX...? it appears that it's attempting to
>>> create the old CDML style LinkNext, LinkPrevious type URL
>>> strings... anyone ever use those these days...?? Is this data also
>>> sued for anything else, I don't think so, since previously I've
>>> just ignored the error, with seemingly no ill effects...
>>>
>>> If it is as legacy as it looks, is it perhaps time to retire that
>>> function...? Any thoughts on how to deal with the array concept in
>>> post variables...? I guess the array could be exploded and then
>>> rebuilt as a strong in the form
>>> array[]=fred&array[]=spoon&array[]=lives&array[]here but if it's
>>> not needed....???
>>>
>>> Cheers
>>> Steve
>>>
>>>
>>> Steve Winter
>>> steve at bluecrocodile.co.nz
>>> m: +44 77 7852 4776
>>> 3 Calshot Court, Channel Way
>>> Ocean Village, Southampton SO14 3GR
>>>
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>>
>> Steve Winter
>> steve at bluecrocodile.co.nz
>> m: +44 77 7852 4776
>> 3 Calshot Court, Channel Way
>> Ocean Village, Southampton SO14 3GR
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
Steve Winter
steve at bluecrocodile.co.nz
m: +44 77 7852 4776
3 Calshot Court, Channel Way
Ocean Village, Southampton SO14 3GR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20090610/043d4b35/attachment.html
More information about the FX.php_List
mailing list