Re: [PHP] Building an array from a URL

2001-04-06 Thread Plutarck

You'll probably want to play with the following function:

http://www.php.net/manual/en/function.parse-url.php


--
Plutarck
Should be working on something...
...but forgot what it was.


"Mike Gifford" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 I'm trying to build an array out of data submitted from a URL.

 Essentially, I want to pull certain records out of a database which have
been
 selected on another form.

 The URL presently looks like this:

superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188

 I'd like to take these independent variables and merge them into a single
array:
 $array_superRSS = implode (":", $superRSS[]);

 So I can then pipe these values directly into another function:

 while ($array_superRSS) {
 display_superRSS($array_superRSS[]);
 }

 Obviously I'm missing a step or two here, but would really appreciate
someone
 filling in some of the gaps.

 Thanks!

 Mike
 --
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://www.aboriginalrightscoalition.ca/
 If a book doesn't make us better, then what on earth is it for? - Alice
Walker

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Building an array from a URL

2001-04-06 Thread Jonathan Sharp

can you just use a POST instead of a get? seems it might be cleaner in this
case...

-js

 -Original Message-
 From: Plutarck [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 05, 2001 11:22 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Building an array from a URL


 You'll probably want to play with the following function:

 http://www.php.net/manual/en/function.parse-url.php


 --
 Plutarck
 Should be working on something...
 but forgot what it was.


 "Mike Gifford" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
 
  I'm trying to build an array out of data submitted from a URL.
 
  Essentially, I want to pull certain records out of a database which have
 been
  selected on another form.
 
  The URL presently looks like this:
 
 superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRS
 S175=1188
 
  I'd like to take these independent variables and merge them
 into a single
 array:
  $array_superRSS = implode (":", $superRSS[]);
 
  So I can then pipe these values directly into another function:
 
  while ($array_superRSS) {
  display_superRSS($array_superRSS[]);
  }
 
  Obviously I'm missing a step or two here, but would really appreciate
 someone
  filling in some of the gaps.
 
  Thanks!
 
  Mike
  --
  Mike Gifford, OpenConcept Consulting, http://openconcept.ca
  Offering everything your organization needs for an effective web site.
  Featured Client: http://www.aboriginalrightscoalition.ca/
  If a book doesn't make us better, then what on earth is it for? - Alice
 Walker
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Building an array from a URL

2001-04-05 Thread Mike Gifford

Hi Joe,

this would be useful if I wanted to write to a URL, but I need to read from it. 
Perhaps I wasn't clear in this.

Mike

Joe Stump wrote:
 Ok - say you have this:
 $foo = array(
 0 = 'joe',
 1 = 'stump',
 2 = 'there');
 
 while(list($key,$val) = each($foo))
   $args[] = 'array['.$key.']='.$val;
 
 $url = 'http://www.server.com/script.html';
 $url .= '?'.implode('',$args);
 
 header("Location: $url");
 exit;
 
 That has worked for me before and will most likely work again.
 
 --Joe
 
 On Wed, Apr 04, 2001 at 09:42:20PM -0400, Mike Gifford wrote:
  Hi Joe,
 
  I don't doubt that at all..  However, my strings aren now looking like this.
 
  
http://openconcept.ca/rabble/superRSS.phtml?Title%5B1000%5D=RBC+Dominion+Securities+investigates+URL%5B1000%5D=http%3A%2F%2Fcbc.ca%2Fcgi-bin%2Ftemplates%2Fview.cgi%3F%2Fnews%2F2001%2F04%2F04%2Frbcds_010404Abstract%5B1000%5D=RBC+Dominion+Securities+said+Wednesday+morning+it+is+launching+an++investigation+of+some+suspicious+trading.+%0D%0ATitle%5B1184%5D=Indigenous+Peoples+Critical+of+The+Human+Genome+ProjectURL%5B1184%5D=http%3A%2F%2Fwww.wtowatch.org%2Fwtowatch%2Fnews%2Findex.cfm%3FID%3D2113Abstract%5B1184%5D=aanew_superRSS=new_superRSS
 
  I've got the $Title[1000]=, but it looks like Title%5B1000%5D=
 
  Also, I'm having trouble extracting arrays from arrays..  I just want to insert
  the new values (for articleID 1000, etc.) into a table..
 
  Any suggestions?
 
  Mike
 
  Joe Stump wrote:
   It works for me in production.
  
   On Wed, Apr 04, 2001 at 08:56:53PM -0400, Mike Gifford wrote:
I tried this, but it converted [ and ] to url friendly codes.  Does this still
work?
   
Mike
   
Joe Stump wrote:
 FYI you can send data like this on the url:

 
http://www.foo.com/script.php?test[joe]=stumptest[harry]=bartest[jane]=scott

 Then $test will be an array that translates to this in PHP:

 ?

   $test = array(
 joe = 'stump',
 harry = 'bar',
 jane = 'scott');

 ?

 --Joe

 On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote:
  Hello,
 
  I'm trying to build an array out of data submitted from a URL.
 
  Essentially, I want to pull certain records out of a database which have 
been
  selected on another form.
 
  The URL presently looks like this:

superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188
 
  I'd like to take these independent variables and merge them into a single 
array:
$array_superRSS = implode (":", $superRSS[]);
 
  So I can then pipe these values directly into another function:
 
  while ($array_superRSS) {
display_superRSS($array_superRSS[]);
  }
 
  Obviously I'm missing a step or two here, but would really appreciate 
someone
  filling in some of the gaps.
 
  Thanks!
 
  Mike
  --
  Mike Gifford, OpenConcept Consulting, http://openconcept.ca
  Offering everything your organization needs for an effective web site.
  Featured Client: http://www.aboriginalrightscoalition.ca/
  If a book doesn't make us better, then what on earth is it for? - Alice 
Walker
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

 
/**\
  *Joe Stump - PHP/SQL/HTML Developer 
 *
  * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net  
 *
  * "Better to double your money on mediocrity than lose it all on a dream."  
 *
 
\**/
   
--
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Featured Client: http://www.aboriginalrightscoalition.ca/
If a book doesn't make us better, then what on earth is it for? - Alice Walker
  
   /**\
*Joe Stump - PHP/SQL/HTML Developer  *
* http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
* "Better to double your money on mediocrity than lose it all on a dream."   *
   \**/
 
  --
  Mike Gifford, OpenConcept Consulting, http://openconcept.ca
  Offering everything your organization needs for an effective web site.
  Featured Client: http://www.aboriginalrightscoalition.ca/
  If a book doesn't make 

[PHP] Building an array from a URL

2001-04-04 Thread Mike Gifford

Hello,

I'm trying to build an array out of data submitted from a URL.  

Essentially, I want to pull certain records out of a database which have been
selected on another form.  

The URL presently looks like this:
superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188

I'd like to take these independent variables and merge them into a single array:
$array_superRSS = implode (":", $superRSS[]);

So I can then pipe these values directly into another function:

while ($array_superRSS) {
display_superRSS($array_superRSS[]);
}

Obviously I'm missing a step or two here, but would really appreciate someone
filling in some of the gaps.

Thanks!

Mike
-- 
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Featured Client: http://www.aboriginalrightscoalition.ca/
If a book doesn't make us better, then what on earth is it for? - Alice Walker

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Building an array from a URL

2001-04-04 Thread Joe Stump

FYI you can send data like this on the url:

http://www.foo.com/script.php?test[joe]=stumptest[harry]=bartest[jane]=scott

Then $test will be an array that translates to this in PHP:

?

  $test = array(
joe = 'stump',
harry = 'bar',
jane = 'scott');

?

--Joe

On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote:
 Hello,
 
 I'm trying to build an array out of data submitted from a URL.  
 
 Essentially, I want to pull certain records out of a database which have been
 selected on another form.  
 
 The URL presently looks like this:
   superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188
 
 I'd like to take these independent variables and merge them into a single array:
   $array_superRSS = implode (":", $superRSS[]);
 
 So I can then pipe these values directly into another function:
 
 while ($array_superRSS) {
   display_superRSS($array_superRSS[]);
 }
 
 Obviously I'm missing a step or two here, but would really appreciate someone
 filling in some of the gaps.
 
 Thanks!
 
 Mike
 -- 
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://www.aboriginalrightscoalition.ca/
 If a book doesn't make us better, then what on earth is it for? - Alice Walker
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Building an array from a URL

2001-04-04 Thread Knut H. Hassel Nielsen


Did you try to see if $HTTP_GET_VARS can help you ?

Its an array of every variable posted by GET (the way you described)

Else :

Split the different key/values with the delimiter '' and thereafter split the
elements in the array by '='

But first split the string into page and variables :

list( $page, $str ) = 
split("?","superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188");

function make_arr_from_str( $str ) {
  $exp_arr = Explode( "", $str );
  $new_arr = Array();
  for ( $i = 0 ; $i  count( $exp_arr ) ; $i++ ) {
list( $key, $val ) = split( "=", $exp_arr[ $i ] );
$new_arr["$key"] = $val;
  }
  return $new_arr;
}

$array = make_arr_from_str( $str );
var_dump($array);



On Wed, 4 Apr 2001, Mike Gifford wrote:

 Hello,

 I'm trying to build an array out of data submitted from a URL.

 Essentially, I want to pull certain records out of a database which have been
 selected on another form.

 The URL presently looks like this:
   superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188

 I'd like to take these independent variables and merge them into a single array:
   $array_superRSS = implode (":", $superRSS[]);

 So I can then pipe these values directly into another function:

 while ($array_superRSS) {
   display_superRSS($array_superRSS[]);
 }

 Obviously I'm missing a step or two here, but would really appreciate someone
 filling in some of the gaps.

 Thanks!

 Mike


-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingenir
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Building an array from a URL

2001-04-04 Thread Delbono

I think the function parse_str does exactly what you want.

http://www.php.net/manual/en/function.parse-str.php






- Original Message -
From: "Knut H. Hassel Nielsen" [EMAIL PROTECTED]
To: "Mike Gifford" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, April 04, 2001 6:12 PM
Subject: Re: [PHP] Building an array from a URL



Did you try to see if $HTTP_GET_VARS can help you ?

Its an array of every variable posted by GET (the way you described)

Else :

Split the different key/values with the delimiter '' and thereafter split
the
elements in the array by '='

But first split the string into page and variables :

list( $page, $str ) =
split("?","superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRS
S175=1188");

function make_arr_from_str( $str ) {
  $exp_arr = Explode( "", $str );
  $new_arr = Array();
  for ( $i = 0 ; $i  count( $exp_arr ) ; $i++ ) {
list( $key, $val ) = split( "=", $exp_arr[ $i ] );
$new_arr["$key"] = $val;
  }
  return $new_arr;
}

$array = make_arr_from_str( $str );
var_dump($array);



On Wed, 4 Apr 2001, Mike Gifford wrote:

 Hello,

 I'm trying to build an array out of data submitted from a URL.

 Essentially, I want to pull certain records out of a database which have
been
 selected on another form.

 The URL presently looks like this:

superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188

 I'd like to take these independent variables and merge them into a single
array:
 $array_superRSS = implode (":", $superRSS[]);

 So I can then pipe these values directly into another function:

 while ($array_superRSS) {
 display_superRSS($array_superRSS[]);
 }

 Obviously I'm missing a step or two here, but would really appreciate
someone
 filling in some of the gaps.

 Thanks!

 Mike


--
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingenir
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Building an array from a URL

2001-04-04 Thread Mike Gifford

I tried this, but it converted [ and ] to url friendly codes.  Does this still
work?

Mike

Joe Stump wrote:
 FYI you can send data like this on the url:
 
 http://www.foo.com/script.php?test[joe]=stumptest[harry]=bartest[jane]=scott
 
 Then $test will be an array that translates to this in PHP:
 
 ?
 
   $test = array(
 joe = 'stump',
 harry = 'bar',
 jane = 'scott');
 
 ?
 
 --Joe
 
 On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote:
  Hello,
 
  I'm trying to build an array out of data submitted from a URL.
 
  Essentially, I want to pull certain records out of a database which have been
  selected on another form.
 
  The URL presently looks like this:
superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188
 
  I'd like to take these independent variables and merge them into a single array:
$array_superRSS = implode (":", $superRSS[]);
 
  So I can then pipe these values directly into another function:
 
  while ($array_superRSS) {
display_superRSS($array_superRSS[]);
  }
 
  Obviously I'm missing a step or two here, but would really appreciate someone
  filling in some of the gaps.
 
  Thanks!
 
  Mike
  --
  Mike Gifford, OpenConcept Consulting, http://openconcept.ca
  Offering everything your organization needs for an effective web site.
  Featured Client: http://www.aboriginalrightscoalition.ca/
  If a book doesn't make us better, then what on earth is it for? - Alice Walker
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 /**\
  *Joe Stump - PHP/SQL/HTML Developer  *
  * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
  * "Better to double your money on mediocrity than lose it all on a dream."   *
 \**/

-- 
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Featured Client: http://www.aboriginalrightscoalition.ca/
If a book doesn't make us better, then what on earth is it for? - Alice Walker

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Building an array from a URL

2001-04-04 Thread Joe Stump

It works for me in production.

On Wed, Apr 04, 2001 at 08:56:53PM -0400, Mike Gifford wrote:
 I tried this, but it converted [ and ] to url friendly codes.  Does this still
 work?
 
 Mike
 
 Joe Stump wrote:
  FYI you can send data like this on the url:
  
  http://www.foo.com/script.php?test[joe]=stumptest[harry]=bartest[jane]=scott
  
  Then $test will be an array that translates to this in PHP:
  
  ?
  
$test = array(
  joe = 'stump',
  harry = 'bar',
  jane = 'scott');
  
  ?
  
  --Joe
  
  On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote:
   Hello,
  
   I'm trying to build an array out of data submitted from a URL.
  
   Essentially, I want to pull certain records out of a database which have been
   selected on another form.
  
   The URL presently looks like this:
 superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188
  
   I'd like to take these independent variables and merge them into a single array:
 $array_superRSS = implode (":", $superRSS[]);
  
   So I can then pipe these values directly into another function:
  
   while ($array_superRSS) {
 display_superRSS($array_superRSS[]);
   }
  
   Obviously I'm missing a step or two here, but would really appreciate someone
   filling in some of the gaps.
  
   Thanks!
  
   Mike
   --
   Mike Gifford, OpenConcept Consulting, http://openconcept.ca
   Offering everything your organization needs for an effective web site.
   Featured Client: http://www.aboriginalrightscoalition.ca/
   If a book doesn't make us better, then what on earth is it for? - Alice Walker
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
  /**\
   *Joe Stump - PHP/SQL/HTML Developer  *
   * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
   * "Better to double your money on mediocrity than lose it all on a dream."   *
  \**/
 
 -- 
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://www.aboriginalrightscoalition.ca/
 If a book doesn't make us better, then what on earth is it for? - Alice Walker


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Building an array from a URL

2001-04-04 Thread Mike Gifford

Hi Joe,

I don't doubt that at all..  However, my strings aren now looking like this.

http://openconcept.ca/rabble/superRSS.phtml?Title%5B1000%5D=RBC+Dominion+Securities+investigates+URL%5B1000%5D=http%3A%2F%2Fcbc.ca%2Fcgi-bin%2Ftemplates%2Fview.cgi%3F%2Fnews%2F2001%2F04%2F04%2Frbcds_010404Abstract%5B1000%5D=RBC+Dominion+Securities+said+Wednesday+morning+it+is+launching+an++investigation+of+some+suspicious+trading.+%0D%0ATitle%5B1184%5D=Indigenous+Peoples+Critical+of+The+Human+Genome+ProjectURL%5B1184%5D=http%3A%2F%2Fwww.wtowatch.org%2Fwtowatch%2Fnews%2Findex.cfm%3FID%3D2113Abstract%5B1184%5D=aanew_superRSS=new_superRSS

I've got the $Title[1000]=, but it looks like Title%5B1000%5D=

Also, I'm having trouble extracting arrays from arrays..  I just want to insert
the new values (for articleID 1000, etc.) into a table..

Any suggestions?

Mike

Joe Stump wrote:
 It works for me in production.
 
 On Wed, Apr 04, 2001 at 08:56:53PM -0400, Mike Gifford wrote:
  I tried this, but it converted [ and ] to url friendly codes.  Does this still
  work?
 
  Mike
 
  Joe Stump wrote:
   FYI you can send data like this on the url:
  
   http://www.foo.com/script.php?test[joe]=stumptest[harry]=bartest[jane]=scott
  
   Then $test will be an array that translates to this in PHP:
  
   ?
  
 $test = array(
   joe = 'stump',
   harry = 'bar',
   jane = 'scott');
  
   ?
  
   --Joe
  
   On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote:
Hello,
   
I'm trying to build an array out of data submitted from a URL.
   
Essentially, I want to pull certain records out of a database which have been
selected on another form.
   
The URL presently looks like this:
  
superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188
   
I'd like to take these independent variables and merge them into a single 
array:
  $array_superRSS = implode (":", $superRSS[]);
   
So I can then pipe these values directly into another function:
   
while ($array_superRSS) {
  display_superRSS($array_superRSS[]);
}
   
Obviously I'm missing a step or two here, but would really appreciate someone
filling in some of the gaps.
   
Thanks!
   
Mike
--
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Featured Client: http://www.aboriginalrightscoalition.ca/
If a book doesn't make us better, then what on earth is it for? - Alice Walker
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
   /**\
*Joe Stump - PHP/SQL/HTML Developer  *
* http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
* "Better to double your money on mediocrity than lose it all on a dream."   *
   \**/
 
  --
  Mike Gifford, OpenConcept Consulting, http://openconcept.ca
  Offering everything your organization needs for an effective web site.
  Featured Client: http://www.aboriginalrightscoalition.ca/
  If a book doesn't make us better, then what on earth is it for? - Alice Walker
 
 /**\
  *Joe Stump - PHP/SQL/HTML Developer  *
  * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
  * "Better to double your money on mediocrity than lose it all on a dream."   *
 \**/

-- 
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Featured Client: http://www.aboriginalrightscoalition.ca/
If a book doesn't make us better, then what on earth is it for? - Alice Walker

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Building an array from a URL

2001-04-04 Thread Mike Gifford

Hell Knut,

"Knut H. Hassel Nielsen" wrote:
 Did you try to see if $HTTP_GET_VARS can help you ?

It's useful for pulling down the URL variables into an array, however I'd now
like to go to the next step of pulling out data of an array of arrays...

All of the files here are in a database.  
http://openconcept.ca/rabble/newsfeeds.phtml

Select a number of them and it brings you here:
http://openconcept.ca/rabble/superRSS.phtml?superRSS173=1170superRSS177=1189

Pulls in the right data and everything.

However, I'd now like to write this data to a database (after making minor
adjustments):

http://openconcept.ca/rabble/superRSS.phtml?Title%5B1170%5D=ANTI-FTAA+TOUR+TO+THE+NORTHEASTERN+UNITED+STATESURL%5B1170%5D=http%3A%2F%2FProtest.Net%2Fview.cgi%3Fview%3D2052Abstract%5B1170%5D=ddTitle%5B1189%5D=Rich+World%27s+Trade+Ministers+Discuss+New+Trade+RoundURL%5B1189%5D=http%3A%2F%2Fwww.wtowatch.org%2Fwtowatch%2Fnews%2Findex.cfm%3FID%3D2108Abstract%5B1189%5D=ddnew_superRSS=new_superRSS

However I now have an array of arrays to seperate and it doesn't seem to be
working like the first one did.

 Its an array of every variable posted by GET (the way you described)

It was a GET  not POST indeed.
 
 Else :
 Split the different key/values with the delimiter '' and thereafter split the
 elements in the array by '='

How do I pull in this data if not as an array?

Mike
-- 
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Featured Client: http://www.aboriginalrightscoalition.ca/
If a book doesn't make us better, then what on earth is it for? - Alice Walker

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Building an array from a URL

2001-04-04 Thread Joe Stump

Ok - say you have this:

$foo = array(
0 = 'joe',
1 = 'stump',
2 = 'there');

while(list($key,$val) = each($foo))
  $args[] = 'array['.$key.']='.$val;

$url = 'http://www.server.com/script.html';
$url .= '?'.implode('',$args);

header("Location: $url");
exit;

That has worked for me before and will most likely work again.

--Joe

On Wed, Apr 04, 2001 at 09:42:20PM -0400, Mike Gifford wrote:
 Hi Joe,
 
 I don't doubt that at all..  However, my strings aren now looking like this.
 
 
http://openconcept.ca/rabble/superRSS.phtml?Title%5B1000%5D=RBC+Dominion+Securities+investigates+URL%5B1000%5D=http%3A%2F%2Fcbc.ca%2Fcgi-bin%2Ftemplates%2Fview.cgi%3F%2Fnews%2F2001%2F04%2F04%2Frbcds_010404Abstract%5B1000%5D=RBC+Dominion+Securities+said+Wednesday+morning+it+is+launching+an++investigation+of+some+suspicious+trading.+%0D%0ATitle%5B1184%5D=Indigenous+Peoples+Critical+of+The+Human+Genome+ProjectURL%5B1184%5D=http%3A%2F%2Fwww.wtowatch.org%2Fwtowatch%2Fnews%2Findex.cfm%3FID%3D2113Abstract%5B1184%5D=aanew_superRSS=new_superRSS
 
 I've got the $Title[1000]=, but it looks like Title%5B1000%5D=
 
 Also, I'm having trouble extracting arrays from arrays..  I just want to insert
 the new values (for articleID 1000, etc.) into a table..
 
 Any suggestions?
 
 Mike
 
 Joe Stump wrote:
  It works for me in production.
  
  On Wed, Apr 04, 2001 at 08:56:53PM -0400, Mike Gifford wrote:
   I tried this, but it converted [ and ] to url friendly codes.  Does this still
   work?
  
   Mike
  
   Joe Stump wrote:
FYI you can send data like this on the url:
   
http://www.foo.com/script.php?test[joe]=stumptest[harry]=bartest[jane]=scott
   
Then $test will be an array that translates to this in PHP:
   
?
   
  $test = array(
joe = 'stump',
harry = 'bar',
jane = 'scott');
   
?
   
--Joe
   
On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote:
 Hello,

 I'm trying to build an array out of data submitted from a URL.

 Essentially, I want to pull certain records out of a database which have been
 selected on another form.

 The URL presently looks like this:
   
superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188

 I'd like to take these independent variables and merge them into a single 
array:
   $array_superRSS = implode (":", $superRSS[]);

 So I can then pipe these values directly into another function:

 while ($array_superRSS) {
   display_superRSS($array_superRSS[]);
 }

 Obviously I'm missing a step or two here, but would really appreciate someone
 filling in some of the gaps.

 Thanks!

 Mike
 --
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://www.aboriginalrightscoalition.ca/
 If a book doesn't make us better, then what on earth is it for? - Alice 
Walker

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
   

/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   *

\**/
  
   --
   Mike Gifford, OpenConcept Consulting, http://openconcept.ca
   Offering everything your organization needs for an effective web site.
   Featured Client: http://www.aboriginalrightscoalition.ca/
   If a book doesn't make us better, then what on earth is it for? - Alice Walker
  
  /**\
   *Joe Stump - PHP/SQL/HTML Developer  *
   * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
   * "Better to double your money on mediocrity than lose it all on a dream."   *
  \**/
 
 -- 
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://www.aboriginalrightscoalition.ca/
 If a book doesn't make us better, then what on earth is it for? - Alice Walker


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com -