470,833 Members | 1,346 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Passing Parameters Script

JD
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
Jul 17 '05 #1
4 1740
On Sun, 27 Jun 2004 09:23:03 -0400, JD <jd******@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/
Jul 17 '05 #2
On Sun, 27 Jun 2004 15:41:16 +0200, Marian Heddesheimer
<26*************@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/
Jul 17 '05 #3
JD
Marian Heddesheimer wrote:
On Sun, 27 Jun 2004 15:41:16 +0200, Marian Heddesheimer
<26*************@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
Jul 17 '05 #4
On Sun, 27 Jun 2004 10:13:44 -0400, JD <jd******@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/
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by JD | last post: by
1 post views Thread by Mike Wimpe | last post: by
7 posts views Thread by Pavils Jurjans | last post: by
3 posts views Thread by domeceo | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.