Re: how to pass PhP variables thru HREF command

From: Date: Fri, 22 Jun 2001 06:55:20 +0000
Subject: Re: how to pass PhP variables thru HREF command
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-54845@lists.php.net to get a copy of this message
On Fri, 22 Jun 2001 10:15, David Yen wrote: > Hi. > > am using SQL Server. > I wrote a php page that displays the NFL game schedule after query the > database. > I want to create link to a game prediction page (written in php) for > each game. There will be two variables that will be passed thru the > Href command. > > Would the code look something like this? > > <a href="prediction.php?hometeam=<?echo $hometeam?>&awayteam=<?echo > $awayteam?>"> > ............</a> > > Thank you for your help. If you are going to pass values as part of the URL you should urlencode() them to avoid problems with spaces and other interesting characters. So <a href="prediction.php?hometeam=<?echo urlencode($hometeam) ?>&awayteam=<? echo urlencode($awayteam) ?>"> -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA "I'm wearing my wedding ring," said Tom with abandon.

« previous php.general (#54845) next »