Passing two variables in URL
am 05.01.2006 16:41:32 von Home
The web site (a cycling one) can list one or more events happening at
different locales on the same day.
To differentiate between events happening on the same day, when I make
the hyperlink -
print("
href=\"fun_runs_individual.php?id=$Row[event_date]&$Row[even t]\">$Row[event]
$Row[event_date]");
the status bar shows the full combination (e.g.
id=http://domain/fun_runs_individual.php?id=2005-01-01&Fintr y 2005) and
that appears in the address bar of the next screen as
http://domain/fun_runs_individual.php?id=2005-01-01&Fintry%2 02005
In that following page, when I take the $id to try and separate the two
elements so I can search the table for all entries which have the chosen
event_date and the chosen event, all that $id prints out as is the event
date.
I've never tried to pass two variables at once before this and just
supposed it would work. Am I missing something blindingly obvious?
Re: Passing two variables in URL
am 05.01.2006 17:19:02 von zeldorblat
home wrote:
> The web site (a cycling one) can list one or more events happening at
> different locales on the same day.
> To differentiate between events happening on the same day, when I make
> the hyperlink -
> print("
> href=\"fun_runs_individual.php?id=$Row[event_date]&$Row[even t]\">$Row[event]
$Row[event_date]");
> the status bar shows the full combination (e.g.
> id=http://domain/fun_runs_individual.php?id=2005-01-01&Fintr y 2005) and
> that appears in the address bar of the next screen as
> http://domain/fun_runs_individual.php?id=2005-01-01&Fintry%2 02005
> In that following page, when I take the $id to try and separate the two
> elements so I can search the table for all entries which have the chosen
> event_date and the chosen event, all that $id prints out as is the event
> date.
> I've never tried to pass two variables at once before this and just
> supposed it would work. Am I missing something blindingly obvious?
Just give the two variables different names:
http://domain/fun_runs_individual.php?date=2005-01-01&name=F intry%202005
Then on the next page you'll have $_GET['date'] and $_GET['name'].