SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 15th, 2002, 02:37 PM
Kanu Kanu is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 91 Kanu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Passing values into an array

Hi, is there a simple and easy way of passing values from page A into specified arrays on page B? Eg, $somevariable from one page is passed either by GET or POST into $somearray[somevalue] on page B. Better yet, I don't want to have to edit page B to do something like $somearray[somevalue]=$somevalue. Any luck for me?

Reply With Quote
  #2  
Old December 15th, 2002, 07:07 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
is what your trying to say is that you want to send an array to a another page, as an array?

Reply With Quote
  #3  
Old December 16th, 2002, 09:32 AM
crazytrain81 crazytrain81 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 232 crazytrain81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
store it in a session variable, or serialize it and pass it in the querystring

Reply With Quote
  #4  
Old December 16th, 2002, 03:19 PM
Kanu Kanu is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 91 Kanu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Quote:
Originally posted by crazytrain81
store it in a session variable, or serialize it and pass it in the querystring
So, I must learn sessions, and place these values into an array that is stored in the session the next page will call?

Reply With Quote
  #5  
Old December 16th, 2002, 03:57 PM
crazytrain81 crazytrain81 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 232 crazytrain81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
what i meant to say was, serialize THEn store in a session variable or querystring. sessions are easy!

PHP Code:
 session_start();
$_SESSION['var'] = serialize($somevariable); 

Reply With Quote
  #6  
Old December 16th, 2002, 07:05 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
this is what i would do.

$array = array('value1', 'value1', 'value2', 'value3', 'value4');

$data = implode(",", $array);

//$data = "value1,value1,value2,value3,value4";

then you can send that via a link, or in a hidden form field, etc

once you goto the next page, sending $data to it,

the you use the following exampel

$array = explode(",", $_GET['data']);

the url submitted would look something like

fil.php?data = value1,value1,value2,value3,value4

Reply With Quote
  #7  
Old December 17th, 2002, 02:07 PM
Kanu Kanu is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 91 Kanu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thanks guys, I *think* I know what I'm doing now

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Passing values into an array


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 | 
  
 





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