My second question about PHP

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Tue Mar 11, 2003 2:02 pm

I'm passing variables in an <a href=filename?vab1=$vab2&vab2=$vab2&ray=$ray>click</a> construction. The variables pass fine, but the "ray" which is an array does not. How do you pass an array along with a url after the "?"

Can't seem to find anything about it in my book on PHP.
Philip Williams
Image

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Tue Mar 11, 2003 3:15 pm

Personally, I didn't think you could... as far as I know you'd have to use a foreach loop to put each array child in its own $_GET variable

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Tue Mar 11, 2003 4:41 pm

That's to bad...

My solution, which might not be the best, but it seems to work. I implode it, send it, and then explode it on the other side.
Philip Williams
Image

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Tue Mar 11, 2003 7:09 pm

I'm really new to PHP... don't know about $_SESSION[] variables yet... Sounds like a global variable??? I'll have to look into it... Thanks.
Philip Williams
Image

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Thu Mar 13, 2003 11:26 am

Solved it in quite a different way so that I don't have to pass the array at all. I'm now using one file with a switch statement. The file calls itself with different values for the switch. Each switch/case in the file is a different page display that uses information from an array in an init section at the head of the file. ....so, several pages from one file with no need to pass arrays between files. Interesting.... cool stuff, this PHP 8)
Philip Williams
Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider] and 14 guests