On Fri, 2003-10-10 at 07:41, Donaldson Sgt Michael J wrote:
> $s_array1 = serialize($results);
> 
> echo "<img src= \"gd_graph.php?h_array=urlencode($s_array1) \" >";
> 
> What's the problem with this code? I am trying to pass an array to create
> graph but instead of the pic i get this in my browser. Probably do to bad
> HTML syntax. Can I urlencode in a get or does it have to be a hidden
> variable in a post?
> 
> <img src=
> "gd_graph.php?h_array=urlencode(a:2:{s:7:"PROGRAM";a:2:{i:0;s:6:"LBIVII";i:1
> ;s:9:"web_count";}s:3:"NUM";a:2:{i:0;s:2:"69";i:1;s:2:"91";}}) " >

You need to either move the urlencode function outside of the quotes

echo "<img src=\"gd_graph.php?harray=",urlencode($s_array1),"\">";

Or encode it first:

$s_array1_encoded = urlencode($s_array1);

echo "<img src=\"gd_graph.php?harray=$s_array1_encoded\">";

I think the second is easier to understand. 

- Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to