Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The Character & is giving me problems in the URL 1

Status
Not open for further replies.

likelylad

IS-IT--Management
Joined
Jul 4, 2002
Messages
388
Location
GB
I have 2 php pages.

On Page 1 there is a table listing company names.
The company name contains a hyperlink to page 2 where it brings up the company details.

The problem I have is that if the company name is like Michael & Mouse Ltd then no information is brought up.

I know why the problem is occuring but I do not know how the solve it. At the moment I am manually changing the name to Michael And Mouse Ltd to get around the issue.

The URl I am using on page 1 is as follows
printf(&quot;<tr><td><a href=\&quot;[Company_Name]\&quot;>$companyname</a></td></tr>\n&quot;);
 
& is a reserved key word. like:
asd.php?vl=1&vl1=2

in asd.php
echo $_GET['vl1']; //will give 2.

so do this:
printf(&quot;<tr><td><a href=\&quot;[Company_Name]).&quot;\&quot;>$companyname</a></td></tr>\n&quot;);



and in page2:
$comp=urldecode($_GET['companyname']);
echo $comp;

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top