php get command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jcomputer
    New Member
    • Jun 2007
    • 7

    #1

    php get command

    Hi,

    I am using the $_GET command to grab the url for a redirection but my urls are over 100 characters so its not going to the link i want it to. Is there a way i can get it to work with over 100 characters?

    PS. I dont have a form at all i just need the page to redirect to a website that is placed in the url ex. www.mysites.com/redirect.php?go to=http://www.google.com except the site i go to is longer then teh google address.
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    I am using the $_GET command to grab the url for a redirection but my urls are over 100 characters so its not going to the link i want it to.
    Are you sure about this?

    This may be due the spaces, & or other characters in the URL. You should use urlencode() to send URL as a paramter.

    Comment

    • kovik
      Recognized Expert Top Contributor
      • Jun 2007
      • 1044

      #3
      I believe URLs can be around 700 characters long. It shouldn't be an issue of length.

      Comment

      • jcomputer
        New Member
        • Jun 2007
        • 7

        #4
        Thanks guys for the quick help but i just noticed what the problem was. The site i redirect to has variables in its url and it was messing up my url because they were using & so i had to change it to %26

        Comment

        • kovik
          Recognized Expert Top Contributor
          • Jun 2007
          • 1044

          #5
          Yes, as mwasif said. Don't manually change them... urlencode() does that for you.

          Comment

          Working...