mmosel Posted June 9, 2006 Share Posted June 9, 2006 I've written my site using &sub in my url for getting to certain sub-pages. The only problem is that when I use the php variable $_SERVER["REQUEST_URI"] I get back a math character '⊂' . Strange. Technically, that should equal ⊂ but my url doesn' have the semicolon. I thought I could just replace the ⊂ with &sub in my script and it would work, but my editing tools don't recognize the character!Worst case scenario is that I'm going to have to rewrite my whole site to use a different variable for the sub-page. That is unless someone here has a bright idea!Word to the wise - don't use &sub as a variable in your script for URLs.(as in ?page=this&sub=that)There's alot more to avoid too...[a href=\"http://en.wikipedia.org/wiki/Help:Filling_the_page\" target=\"_blank\"]http://en.wikipedia.org/wiki/Help:Filling_the_page[/a] See the bottom of this page for more... Quote Link to comment https://forums.phpfreaks.com/topic/11617-help-ive-got-a-prob-using-sub-in-my-url/ Share on other sites More sharing options...
poirot Posted June 9, 2006 Share Posted June 9, 2006 That's because it's a HTML entity. You should use:?page=this&sub=that Quote Link to comment https://forums.phpfreaks.com/topic/11617-help-ive-got-a-prob-using-sub-in-my-url/#findComment-43868 Share on other sites More sharing options...
mmosel Posted June 9, 2006 Author Share Posted June 9, 2006 [!--quoteo(post=382085:date=Jun 9 2006, 05:40 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 9 2006, 05:40 PM) [snapback]382085[/snapback][/div][div class=\'quotemain\'][!--quotec--]That's because it's a HTML entity. You should use:?page=this&sub=that[/quote]That's for HTML output, not URLs I believe. URL encoding is different.I actually tried that, but my script didn't recognize that. & should be correct for PHP and it does normally work. Quote Link to comment https://forums.phpfreaks.com/topic/11617-help-ive-got-a-prob-using-sub-in-my-url/#findComment-43869 Share on other sites More sharing options...
poirot Posted June 9, 2006 Share Posted June 9, 2006 OK, then that's just the "HTML illusion". Actually PHP understands that it is &sub and not the math symbol, but once it's printed the browser thinks it's the entity.Internally there should be no issue, but if you want it to be displayed correctly, use htmlentities($_SERVER['REQUEST_URI']); Quote Link to comment https://forums.phpfreaks.com/topic/11617-help-ive-got-a-prob-using-sub-in-my-url/#findComment-43875 Share on other sites More sharing options...
mmosel Posted June 10, 2006 Author Share Posted June 10, 2006 [!--quoteo(post=382092:date=Jun 9 2006, 06:08 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 9 2006, 06:08 PM) [snapback]382092[/snapback][/div][div class=\'quotemain\'][!--quotec--]OK, then that's just the "HTML illusion". Actually PHP understands that it is &sub and not the math symbol, but once it's printed the browser thinks it's the entity.Internally there should be no issue, but if you want it to be displayed correctly, use htmlentities($_SERVER['REQUEST_URI']);[/quote]Ah, maybe that would have worked. I actually just finished combing through my scripts and updating the &sub variable to something else, and now the REQUEST_URI works like I thought it would.Thanks for your tips... Quote Link to comment https://forums.phpfreaks.com/topic/11617-help-ive-got-a-prob-using-sub-in-my-url/#findComment-43891 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.