You are here: Re: Passing two variables in URL « PHP SQL « IT news, forums, messages
Re: Passing two variables in URL

Posted by ZeldorBlat on 10/13/42 11:36

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("<a
> href=\"fun_runs_individual.php?id=$Row[event_date]&$Row[event]\">$Row[event]<br>$Row[event_date]</a></td>");
> the status bar shows the full combination (e.g.
> id=http://domain/fun_runs_individual.php?id=2005-01-01&Fintry 2005) and
> that appears in the address bar of the next screen as
> http://domain/fun_runs_individual.php?id=2005-01-01&Fintry%202005
> 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=Fintry%202005

Then on the next page you'll have $_GET['date'] and $_GET['name'].

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация