| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | Need valid XHTML Hey. Firstly, I need pages on my webiste to contain the following link: ????: NamePros.com http://www.namepros.com/programming/182162-need-valid-xhtml.html go.php?id=5&url=http://www.newdomain.com however, it's not valid XHTML. So I've encoded it (which looks horrible and I rather I hadn't but I feel its the only way). And now I cannot decode it. I've used urldecode but it still shows: go.php?id%3D5%26url%3Dhttp%3A%2F%2Fwww.newdomain.c om I tried: PHP Code: go.php/5/http://www.domain.com where 5 is the id and http://www.domain.com is the domain. Thanks
__________________ Encenta - Amazon Associates CMS
Last edited by Encenta.com; 03-30-2006 at 03:19 PM.
|
| |
| | #2 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,552
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1. Make sure you have used urlencode() to generate the link 2. Make sure that the name of the parameter in the URL is the same for both pages 3. In the target page you need something like this to fetch the parameter from the URL: $url=urldecode($_GET['url']); 'url' is a litteral name, remove the $ sign and I guess you should be fine Please note that $_GET['url'] and $url are two different variables actually, here I'm assigning the value of $_GET['url'] to $url in PHP code To generate SEO-friendly URLs like go.php/5/http://www.domain.com you could simply used mod_rewrite for automatic URL rewriting so you don't have to handle this in your code...
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | THREAD STARTER #3 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | Thanks sdsinc
__________________ Encenta - Amazon Associates CMS |
| |