How to sort the problem of spaces in urls question?
-
Hi there I have a slight problem which io hope someone might be able to help me with... http://www.something.something/profile/index.php?profile\_id=The Long Knives As you can see this would not show as a proper link because of the spaces in the last bit of the url is there a way that i could say use this http://www.something.something/profile/index.php?profile\_id=The\_Long\_Knives And have some php take out the _ before the page opens, i presume this would be some sort of function in php but not being that up with it am not sure, also if the user puts the original url with the spaces it must use that. Thanks you for any help or advice on the matter in advance Regards Ray
-
Hi there I have a slight problem which io hope someone might be able to help me with... http://www.something.something/profile/index.php?profile\_id=The Long Knives As you can see this would not show as a proper link because of the spaces in the last bit of the url is there a way that i could say use this http://www.something.something/profile/index.php?profile\_id=The\_Long\_Knives And have some php take out the _ before the page opens, i presume this would be some sort of function in php but not being that up with it am not sure, also if the user puts the original url with the spaces it must use that. Thanks you for any help or advice on the matter in advance Regards Ray
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
Hi there I have a slight problem which io hope someone might be able to help me with... http://www.something.something/profile/index.php?profile\_id=The Long Knives As you can see this would not show as a proper link because of the spaces in the last bit of the url is there a way that i could say use this http://www.something.something/profile/index.php?profile\_id=The\_Long\_Knives And have some php take out the _ before the page opens, i presume this would be some sort of function in php but not being that up with it am not sure, also if the user puts the original url with the spaces it must use that. Thanks you for any help or advice on the matter in advance Regards Ray
The better way is to use urlencode. Thats the best way to get rid of spaces.