How to pass slash / in an URL? - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-18-2011, 06:43 AM   #1 (permalink)
Junior Member
 
MossoCloud's Avatar
 
Join Date: Jun 2009
Location: kavoir.com
Posts: 33
Default How to pass slash / in an URL?

On this page there are many abbreviation / acronym entries: Acronyms & Abbreviations: D

They are generated in PHP:

PHP Code:
<a href="/define/<?php echo rawurlencode($abbreviation['title'])?>/">
    <strong><?php echo $abbreviation['title']?></strong>
</a>
I used rawurlencode because many acronyms contain bizarre characters such as #, & and even /.

And the URL requests such as:

What does DA&E stand for? - 1 Acronym Definitions & Meanings

Would first be fed to rawurldecode():

PHP Code:
$acronym rawurldecode('DA%26E'); // $acronym would be 'DA&E'. 
And then used in database queries.

While DA&E is all right, DA/C is not. Try this URL http://abbreviations.wordcrow.com/define/DA%2FC/ and you would end up with Abbreviations & Acronyms Dictionary - Find meanings and definitions of acronyms and abbreviations. which is an error page.

I can extend more code to recognize /define/DA/C/ but it's just weird and non-sensible. I tried both Chrome and Firefox and they all automatically convert DA%2FC to DA/C. But with DA%26E, they don't.

What am I doing wrong? Ain't that / already encoded into '%2F'?? Really weird. Any help would be appreciated!
MossoCloud is offline   Reply With Quote
Sponsored Links
Old 06-16-2011, 01:30 AM   #2 (permalink)
Junior Member
 
danieljames123's Avatar
 
Join Date: May 2011
Posts: 72
Default Re: How to pass slash / in an URL?

Not sure here, but this has me wondering if this is an issue with something such as mod_rewrite rules that are set up. If you have some set up, can you post them here?

_____________________
Php Development India

Last edited by danieljames123; 06-16-2011 at 02:01 AM.
danieljames123 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:44 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting