Forum Moderators: coopster

Message Too Old, No Replies

Couldn't print out an array sent from command line

         

irock

5:53 am on Apr 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I want to have the following codes to print out the 'interfaces' array, but nothing returns.

Here's the URL..
index.php?interfaces%5B%5D=IEEE+1394a&interfaces%5B%5D=IEEE+1394a

if (is_array($interfaces))
{
for ($i = 0; $i < count($interfaces); $i++)
{
$interfacestring .= "$interfaces[$i]";
if ($i!= (count($interfaces)-1))
$interfacestring .= ", ";
}
}
print $interfacestring;

$interfacestring is supposed to be "IEEE 1394a, IEEE1394b"

Is there anything I did wrong?

I am out of ideas.. pls help...

I appreciate your help

dmorison

8:18 pm on Apr 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi irock,

Try...

print_r($_GET);

...to see what PHP is making of the query string. If you don't see $interfaces in there then you need to look at why your script is not seeing GET variables within scope.

Your code is fine.

Cheers.

Fischerlaender

8:24 pm on Apr 26, 2003 (gmt 0)

10+ Year Member



I checked your code on my server, works fine. I think you must have a problem with the GET query string.