[FX.php List] urlencode() expects parameter 1 to be string, array given

Steve Hannah shannah at sfu.ca
Thu Nov 9 12:36:44 MST 2006


This is where a little bit of old fashioned debugging comes in to  
play.  If PHP says that you passed an array into urlencode() then you  
probably did (PHP doesn't usually lie).

Try adding some print and print_r statements in and around the error  
message so you can see exactly what data is being passed around.

In particular, do print_r($var_name) (where $var_name is the name of  
the variable passed to urlencode()) just before the offended urlencode 
() call, to see what this array is.. ...

etc..

The truth will be revealed when you see what is in your variables.

Best regards

Steve
----------------------------------------
Steve Hannah
Web Services Developer

Faculty of Applied Sciences
Simon Fraser University
shannah at sfu.ca
778-782-7228
Homepage: http://www.sjhannah.com
--
Need to build a database driven web application quickly?
Try Dataface: http://fas.sfu.ca/dataface



On 9-Nov-06, at 10:45 AM, Ben Bradley wrote:

> Hi everyone
>
> I've been using FX.php very successfully over the last 6 months to  
> gradually build an intranet database application.
>
> Some of the old pages on our website still use a botched-job way of  
> getting data out of FileMaker and into PHP - building a CDML query  
> eg http://server.domain.com:591/?FMPro-DB=TEST etc...
> Then on the format files I would have some PHP code which captured  
> the filemaker data and turned it into a PHP variable.
> Then I would run an include on that CDML query address which would  
> pull in that code and have the filemaker data saved into PHP  
> variables. Although this method works, it would encounter problems  
> when trying to include a query string that was too long, or trying  
> to save data into a filemaker database was particularly tricky.
>
> Anyway now with FX.php I'm having a problem accessing data from our  
> database.
>
> The PHP error I'm getting is...
> Warning: urlencode() expects parameter 1 to be string, array given  
> in /files/home3/dealerworld/FX.php on line 1425
>
> But the data gets outputted correctly just underneath that error  
> message.
>
>
> The actual live page to see this happening is here...
> http://www.dealer-world.com/page.php?p=amddirectory&s=listingform1
>
> But you'll have to fill in some dummy information to get to the 2nd  
> page of the form where the error's happening - just above the  
> checkboxes.
> It is these checkbox names which are being dragged out of our  
> FileMaker database
>
> I've set up a test page where I've literally copy and pasted the  
> code from that listingform2 page and I don't get the error, even  
> though the PHP code is exactly the same...
> http://www.dealer-world.com/fxtest.php
>
>
> The only difference between the 2 scripts could be that when I'm  
> getting the error, I'm calling FX.php from within an included script.
> Would that cause the problem I'm looking at here?
>
> Any ideas / suggestions?
> I find it strange how I get the error on the main site, but not on  
> my fxtest.php page.
>
>
> Best regards
>
> Ben
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20061109/175ad6f4/attachment.html


More information about the FX.php_List mailing list