SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old June 7th, 2004, 08:51 PM
wingmaster wingmaster is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 wingmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrays & URL's

Hello,

i Have a simple question, hopefully the answer is simple. How would i be able to take variables from a URL and assign the values to an array if the varialbes passed in the URL all have the same name. For example.

HTTP://localhost/test.php?test=valueone&test=valuetwo&test=valuethree

my code is written like so:

$testarray = array ($_GET['test']);

the problem with this code is that after the code is executed the array only contains one value but i need all those three values inside my array.

thanks in advance for any input.

Reply With Quote
  #2  
Old June 8th, 2004, 07:21 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
If you change the field name so that it contains brackets, you'll be good to go:

HTTP://localhost/test.php?test[]=valueone&test[]=valuetwo&test[]=valuethree

$testarray=$_GET["test"];
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old June 8th, 2004, 01:55 PM
wingmaster wingmaster is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 wingmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrays and URL's thank you

i would like to offer you my first born son as a gratitude... whooooo..... it vworked thanks......

Reply With Quote
  #4  
Old June 8th, 2004, 03:27 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Heh, glad to help. I'll let you off on the offer of your firstborn son -- I've got a daughter due in about a week.

Reply With Quote
  #5  
Old June 8th, 2004, 05:45 PM
wingmaster wingmaster is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 wingmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile

awesome congratulations!!! prepare for one heck rollercoaster ride!!!!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Arrays & URL's


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway