Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. How to sort the problem of spaces in urls question?

How to sort the problem of spaces in urls question?

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
helpquestionphpdatabasetutorial
3 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    djhankypark
    wrote on last edited by
    #1

    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

    L J 2 Replies Last reply
    0
    • D djhankypark

      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

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      this[^] might help. :)

      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.

      1 Reply Last reply
      0
      • D djhankypark

        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

        J Offline
        J Offline
        jaypatel512
        wrote on last edited by
        #3

        The better way is to use urlencode. Thats the best way to get rid of spaces.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups