Re: url_encode question
| From: | Marek Kilimajer | Date: | Wed, 05 Nov 2003 16:23:30 +0000 |
| Subject: | Re: url_encode question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168585@lists.php.net to get a copy of this message | ||
You want to use urlencode, but you are using url_encode, which must be user defined function. Urlencode output would be:
http%3A%2F%2F192.168.10.5%2Frecords%2FSalle_16B%2F2003-05-06%2FSalle_16B_2003-05-06.010
urlencode is supposed to be used for encoding values and not the whole url.
Styve Couture wrote:
Hi, I use urlencode to encode some adress in my application. I have notice a strange behavior that I cannot explaned by reading the docs for urlencode(). Those lines will explained what I want to say... $str_nomFichier = "http://" .$GLOBALS["str_IpCW"] ."/records/".$path_salle ."/" .$path_date ."/" .$file; echo $str_nomFichier."<hr>"; $str_nomFichier = url_encode($str_nomFichier); echo $str_nomFichier."<hr>"; exit; result : http://192.168.10.5/records/Salle_16B/2003-05-06/Salle_16B_2003-05-06.010 -------------------------------------------------------------------------------- http://192.168.10.5records/Salle_16B/2003-05-06/Salle_16B_2003-05-06.010 -------------------------------------------------------------------------------- As you can see, my URL miss a '/' beetween the server IP and the rest of the path after using urlencode() ? Anything I have miss ? Win2000, PHP 4.3.3, Apache 2.0.48 Regards. Styve --------------------------------------------------------------------------------Styve Couture Programmeur/Analyste Novo Technologie inc. 49 Rue Du Bel-Air suite 202 Levis (Qc) Canada, G6V 6K9 telephone: 418-833-6601 #244 fax: 418-833-6607 web: www.novo.ca--------------------------------------------------------------------------------