Jump to content

urlencode issue (Maybe?)


tHud

Recommended Posts

Hi :)

I am using urlencode to create links to pages.

 

It all works well until I come up against 'TradeMark' or 'Registered' etc.

 

The snippet below works up to a point...

 


<?php

$pagename = urlencode("Test Device® CR Plus");

touch ("$pagename.htm");

echo "<a href=\"$pagename\">Test Device® CR Plus</a>";

?>

 

The point being, it creates a file called Test+Device%AE+CR+Plus.htm as you would expect.

 

However, when clicking on that link, I get a 404.

 

I checked in the browser window and in the FTP pane and the file is definitely there.

 

However, when clicking on Test+Device%AE+CR+Plus.htm in a browser file listing, this  Test+Device%25AE+CR+Plus.htm  is what I see in the browser navigation bar.

 

Any thoughts on how I can get around this?

 

Thanks.

 

Link to comment
https://forums.phpfreaks.com/topic/226974-urlencode-issue-maybe/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.