Hi,
I've got a php script that receives parts of URLs from another script and
transforms it to be HTTP compliant.
For example, if I receive a parameter like "dir=some directory/" I have to
convert it to "dir=some%20dir ectory/".
I make this with this 2 lines of code:
$str = explode(" ",$_GET["dir"]);
fputs($fp,"GET /share/" . implode("%20",$ str) . " HTTP/1.0\r\n");
Everything was working fine, until I have created a directory called "C++".
I don't know why but the code above convert it to "C ".
It should keep it unchanged, because what the code do is searching for SPACE
characters ' ' only and change it to "%20". I was not expecting that it
would change '+' characters.
What is wrong with the code?
Thanks in advance,
Nuno Paquete
I've got a php script that receives parts of URLs from another script and
transforms it to be HTTP compliant.
For example, if I receive a parameter like "dir=some directory/" I have to
convert it to "dir=some%20dir ectory/".
I make this with this 2 lines of code:
$str = explode(" ",$_GET["dir"]);
fputs($fp,"GET /share/" . implode("%20",$ str) . " HTTP/1.0\r\n");
Everything was working fine, until I have created a directory called "C++".
I don't know why but the code above convert it to "C ".
It should keep it unchanged, because what the code do is searching for SPACE
characters ' ' only and change it to "%20". I was not expecting that it
would change '+' characters.
What is wrong with the code?
Thanks in advance,
Nuno Paquete
Comment