NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Need valid XHTML

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 03-30-2006, 03:13 PM THREAD STARTER               #1 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




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:
urldecode($_GET['$url']);

// ...and...

$url2 $_GET['$url'];
$url urldecode($url2); 
...but it doesn't work. What would be absaloutley perfect would be something like:

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.
Encenta.com is online now  
Old 03-30-2006, 03:50 PM   #2 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,552
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
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
sdsinc is offline  
Old 03-30-2006, 04:00 PM THREAD STARTER               #3 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




Thanks sdsinc
__________________
Encenta - Amazon Associates CMS
Encenta.com is online now  
Old 04-01-2006, 03:17 AM   #4 (permalink)
mch
NamePros Regular
Join Date: Nov 2005
Location: EU
Posts: 248
mch is on a distinguished road
 



A bit offtopic byt why do you use "http://" in the query string? Seems like a waste of 7 bytes
mch is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 02:16 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger