By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,890 Members | 1,048 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,890 IT Pros & Developers. It's quick & easy.

Passing Parameters Script

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.