passing variables
Posted: Wed Jun 04, 2003 2:16 pm
Hey,
I want to pass multiple variables with the get method. The names of the variables are the same.
It works with one variable:
url = http://www.mysite.com/testing.html?name=jon
In my code I write : $variabele = $_GET["name"];
But now!!!!!:
http://www.mysite.com/testing.html?name=jon&name=mike
How can I put the names jon and mike (or even more names) in variables?
If I use: $name = $_GET["name"] , I only get the last name.
I also could write my program that I'll send this:
http://www.mysite.com/testing.html?name1=jon&name2=mike&...
But than I need to know how many variables I'm receiving. If I write:
$variable5 = $_GET["name5"]
and there's no name5, I get a warning. How can I know how many variables there are?
Can someone help me with this?
Thanx
Dirk
I want to pass multiple variables with the get method. The names of the variables are the same.
It works with one variable:
url = http://www.mysite.com/testing.html?name=jon
In my code I write : $variabele = $_GET["name"];
But now!!!!!:
http://www.mysite.com/testing.html?name=jon&name=mike
How can I put the names jon and mike (or even more names) in variables?
If I use: $name = $_GET["name"] , I only get the last name.
I also could write my program that I'll send this:
http://www.mysite.com/testing.html?name1=jon&name2=mike&...
But than I need to know how many variables I'm receiving. If I write:
$variable5 = $_GET["name5"]
and there's no name5, I get a warning. How can I know how many variables there are?
Can someone help me with this?
Thanx
Dirk