Forums

PHP

This topic is locked

Netscape and Detail Page Problem

Posted 04 Mar 2002 22:13:29
1
has voted
04 Mar 2002 22:13:29 Rick Coleman posted:
I have a results page that when you click on the link is supposed to got to a detail page. It works GREAT in IE, but netscape is, as usual, killing me slowly.

If the result has a space in it, IE will automatically insert the asci %20, but netscape will not, so the detail page only reads the letters before the space...


The url is www.eleventhree.com/nae/single.php

Rick!

Replies

Replied 04 Mar 2002 22:59:43
04 Mar 2002 22:59:43 Bruno Mairlot replied:
Rick,

use the function <b>urlencode($string)</b> to get the %20 character.

This function will replace all non-HTTP character to the sequence that the webserver will understand.

For example your link should look like :

<pre id=code><font face=courier size=2 id=code>
&lt;a href="www.eleventhree.com/nae/detail2.php?menuname=<font color=red>&lt;?php echo urlencode("Department Profiles"?&gt;</font id=red>&header=<font color=red>&lt;?php echo urlencode("About NAED"?&gt;</font id=red>"&gt;About NAED&lt;/a&gt;
</font id=code></pre id=code>

will give the following :

<pre id=code><font face=courier size=2 id=code>
&lt;a href="www.eleventhree.com/nae/detail2.php?menuname=Department%20Profiles&header=About%20NAED"&gt;About NAED&lt;/a&gt;
</font id=code></pre id=code>

In hope it helps.

--- Better to die trying, than never try at all ---

Reply to this topic