Passing Parameters Script

This is a discussion on Passing Parameters Script within the PHP Language forums, part of the PHP Programming Forums category; I want to pass two parameters to a simple script running on my web server. The script "parpass.php&...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-27-2004
JD
 
Posts: n/a
Default Passing Parameters Script

I want to pass two parameters to a simple script running on my web server.

The script "parpass.php" looks like this:

<?php
echo "The total number of parameters passed was: $argc \n";
echo "The parameters passed were: ";
foreach (argv as $val) {
echo "$val ";
}
echo " \n ";
?>

I tried running this script by typing this in my browser window

http://www.myserver.org/parpass.php parm1 parm2

The script runs but does not report any parameters

Any help would be appreciated.

I'm new to PHP but am getting better.

Thanks to all

John
Reply With Quote
  #2 (permalink)  
Old 06-27-2004
Marian Heddesheimer
 
Posts: n/a
Default Re: Passing Parameters Script

On Sun, 27 Jun 2004 09:23:03 -0400, JD <jdalton9@cox.net> wrote:

try:

http://www.myserver.org/parpass.php&...t1&parm2=test2

Marian

--
Tipps und Tricks zu PHP, Coaching und Projektbetreuung
http://www.heddesheimer.de/coaching/
Reply With Quote
  #3 (permalink)  
Old 06-27-2004
Marian Heddesheimer
 
Posts: n/a
Default Re: Passing Parameters Script

On Sun, 27 Jun 2004 15:41:16 +0200, Marian Heddesheimer
<260604.8.nolink@spamgourmet.com> wrote:

sorry, should be this:

http://www.myserver.org/parpass.php?...t1&parm2=test2

Marian

--
Tipps und Tricks zu PHP, Coaching und Projektbetreuung
http://www.heddesheimer.de/coaching/
Reply With Quote
  #4 (permalink)  
Old 06-27-2004
JD
 
Posts: n/a
Default Re: Passing Parameters Script

Marian Heddesheimer wrote:

> On Sun, 27 Jun 2004 15:41:16 +0200, Marian Heddesheimer
> <260604.8.nolink@spamgourmet.com> wrote:
>
> sorry, should be this:
>
> http://www.myserver.org/parpass.php?...t1&parm2=test2
>
> Marian
>


Thanks Mariam, This will pass the first parameter OK
but if I add the '& param2=test2' it concantenats it all into one
parameter. I've tried several combinations..

Thanks so far.

John
Reply With Quote
  #5 (permalink)  
Old 06-27-2004
Marian Heddesheimer
 
Posts: n/a
Default Re: Passing Parameters Script

On Sun, 27 Jun 2004 10:13:44 -0400, JD <jdalton9@cox.net> wrote:

>Thanks Mariam, This will pass the first parameter OK
>but if I add the '& param2=test2' it concantenats it all into one
>parameter. I've tried several combinations..


check the array variable $_GET to get the variables individually

echo "<pre>";
print_r($_GET);
echo "</pre>";

Marian

--
Tipps und Tricks zu PHP, Coaching und Projektbetreuung
http://www.heddesheimer.de/coaching/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:44 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0