Need help parsing a URL - php

Discussion in 'PHP' started by webtracker, Oct 17, 2007.

  1. #1
    I'm trying to implement an image editor on a site and, not being a programmer, I'm having trouble figuring our how to parse a URL.

    Here it is:

    http://www.mysite.com/foop.php?image=http://fotos.imageeditorsite.com/2007/10/17/6c59c494.jpg&thumb=http://fotos.imageeditorsite.com/2007/10/17/6c59c494_t.jpg
    Code (markup):
    The idea is to break it up into usable parts. I'd like to eventually spit the "image=" URL back at the user via a TEXTAREA box so they can paste their image wherever they want.

    So...

    I've gotten as far as this:

    User comes to my site. User uses BROWSE/UPLOAD feature and hits enter. User is taken to the image editor site where they interact with their image. User clicks SAVE button on image editor site. Image editor site sends user back to a predetermined page my own site, with the URL listed above.

    At this point I would just see MY PAGE, with that URL in the URL browser box.

    What would I do from here? Any ideas on the code to do this and where I would place it?

    Thanks!
     
    webtracker, Oct 17, 2007 IP
  2. Z.J. van de Weg

    Z.J. van de Weg Peon

    Messages:
    85
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There are loads of tutorials on the web in Dutch, there should be tons in English.. Read one and you'll have your ansers

    PS the reason why I don't type it is simple.. Now you learn to script aswell! :)
     
    Z.J. van de Weg, Oct 17, 2007 IP
  3. webtracker

    webtracker Peon

    Messages:
    108
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Z.J. I tried that before asking here :)

    Problem is I'm not a programmer and I may not even no what to search for. Can you recommend a page?

    I tried searching for "parse url javascript"
     
    webtracker, Oct 17, 2007 IP
  4. ste.richards

    ste.richards Guest

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I would suggest looking in the $_SERVER superglobal and using the explode() function.
     
    ste.richards, Oct 17, 2007 IP
  5. Bishop81

    Bishop81 Peon

    Messages:
    757
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The image URL is held in the $_REQUEST['image'] variable.
    To put it in a textbox, simply add this code to your page.

    $imageurl = $_REQUEST['image'];

    //this shows the textbox. Just place it wherever you want it.
    echo("<input type=\"text\" name=\"image\" value=\"".$imageurl."\">");
     
    Bishop81, Oct 22, 2007 IP