Results 1 to 10 of 17
Threaded View
-
26th Aug 2012, 04:09 PM #1OPMemberWebsite's:
FileShoppe.netPHP problem handling urlencoded '&' (%26) char
Hello all,
A script we are working on deals with passing file names in the URL (via $_GET). Some files contain the '&' symbol in the name.
& is the separator in PHP to identify the new $_GET variable.
We typically use urlencode($theString) to encode 'funny' characters to be URL safe. However, PHP seems to treat the encoded '&' value in exactly the same way as if it were not encoded.
Here is an example of the problem.
File name is Q&A.jpg
The script may be like this
<?php
$fileName = $_GET[fileName];
echo $fileName;
?>
If the url in the browser was script.php?fileName=Q&A.jpg, the output would be Q.
If you url encode the file name, the url would appear as script.php?fileName=Q%26A.jpg
However the output is still just Q without the '&A.jpg'.
Similarly, we have tried using rawurlencode, but this does not fix the problem either.
Anyone familiar with this problem and know a fix?FShoppe Reviewed by FShoppe on . PHP problem handling urlencoded '&' (%26) char Hello all, A script we are working on deals with passing file names in the URL (via $_GET). Some files contain the '&' symbol in the name. & is the separator in PHP to identify the new $_GET variable. We typically use urlencode($theString) to encode 'funny' characters to be URL safe. However, PHP seems to treat the encoded '&' value in exactly the same way as if it were not encoded. Here is an example of the problem. Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Help] Block Spesial Char WHen Reg new username
By -sky- in forum vBulletinReplies: 0Last Post: 14th Dec 2011, 02:48 AM -
Handling over my website to someone trustworthy..,
By souvikroy1111 in forum Community CooperativeReplies: 1Last Post: 4th Aug 2011, 02:52 PM -
Small Footer Problem (<div> problem ??)
By Ashleyuk1984 in forum Technical Help Desk SupportReplies: 2Last Post: 26th Jan 2011, 02:53 PM -
[Selling] Short Url Site, 2 Char domain, Unique Design
By ChaoscripT in forum Completed TransactionsReplies: 0Last Post: 7th Sep 2010, 03:09 PM -
[Shared] Best int-char.com (warez linking iz allowed)
By Int-char.com in forum ArchiveReplies: 3Last Post: 19th Dec 2008, 08:42 AM
themaCreator - create posts from...
Version 3.17 released. Open older version (or...