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&...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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/ |
|
|||
|
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/ |
|
|||
|
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 |
|
|||
|
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/ |