1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Parsing PHP strings in URL (the raw commands)

Discussion in 'HTML, Graphics & Programming' started by theMAD2, 9 Mar 2006.

  1. theMAD2

    Hitman

    Joined: 2 Aug 2005

    Posts: 680

    Does anyone know where I can find the raw commands for different characters to be used when parsing strings in URLs? I've looked but all I can find is the urlencode function. I've got to write the URLs manually.

    Thanks,
    Dan
     
  2. Dj_Jestar

    Caporegime

    Joined: 18 Oct 2002

    Posts: 29,065

    Location: Back in East London

    :confused:

    You've already said the answer.. urlencode()

    Code:
    $urlstring = '?var1=' . urlencode($val1) . '&var2=' . urlencode($val2);
    
    $url = "http://www.domain.com/page.php{$urlstring}":
    
     
  3. theMAD2

    Hitman

    Joined: 2 Aug 2005

    Posts: 680

    lol, sorry mate, I wish I could use urlencode but the CMS won't let me use php code in the WYSIWYG editor.

    For example, I know that "+" is a space and "%40" is an @, I just need to know a few more common ones.

    Thanks a lot.
     
  4. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    Can you not write a plugin/hack the existing code?
     
  5. theMAD2

    Hitman

    Joined: 2 Aug 2005

    Posts: 680

    I'm not at that level yet mate otherwise I would. I already know + is space I just need a few others like : and -
     
  6. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

  7. Augmented

    Soldato

    Joined: 18 Oct 2002

    Posts: 5,464

    Location: London Town

  8. theMAD2

    Hitman

    Joined: 2 Aug 2005

    Posts: 680

    Thanks, that's great! Just what I needed! :D
     
  9. Dj_Jestar

    Caporegime

    Joined: 18 Oct 2002

    Posts: 29,065

    Location: Back in East London

    I just open SciTE, type what I did above with echo in place of $url and press f7 :p