dumb question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
nathanr
Forum Contributor
Posts: 200
Joined: Wed Jun 07, 2006 5:46 pm

Post by nathanr »

out of interest.. could you post the version number of netscape you are using

and.. what happens if you simply create an html document with the source output you posted, does netscape still render the string with the # in it?

lastly.. it would be good to see the http response headers, that way we should be able to get a full grip of exactly what is causing the error.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

webmeister wrote:
Everah wrote:Now t try this and see what comes of it:

Code: Select all

<?php
echo '&x=7&y=12';
echo '<br />';
echo urlencode('&x=7&y=12');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
&x=7&y=12<br />%26x%3D7%26y%3D12
</body>
</html>
So you could use the first of those options to output to the screen, if that is what you are doing. In fact, if you are constructing a URL, you could do that too.
webmeister
Forum Newbie
Posts: 8
Joined: Thu Aug 02, 2007 4:11 pm

Post by webmeister »

VladSun wrote:
webmeister wrote:I also used a network sniffer so I know the php is sending what it's supposed to. I guess netscape inserts the '#' between the '&' and a 'x'; I just don't understand why. Must be a netscape thing!
Maybe because & is special symbol - it marks the begining of HTML entity. And a hex value HTML entity looks like:
&#x31; (that is for '1')
Could be. but it only happens in netscape or at least it doesn't happen in internet explorer.
Thanks for your time.
Post Reply