Need help with XML

Discussion in 'Programming' started by 3l3ctr1c, Dec 2, 2006.

  1. #1
    Hello!

    Everyone, I am currently making my project which involoves images to be automatically uploaded to ImageShack.

    I signed up to ImageShack API and here is the link

    Now I want the "Transloading" method in which I supply a url to the imageshack server and it automatically uploads to it.

    Now as soon as I do it there is a XML page with all the links to the uploaded image. But as ImageShack says "To show the user the results of his or her upload, redirect the user to <done_page>." Now I DO get the done_page after the upload is complete in the XML data.

    Now my question how do I exactly forward the user to the <done_page> as soon as the upload is complete ?


    Thanks in Advance!
    3l3ctr1c
     
    3l3ctr1c, Dec 2, 2006 IP
  2. vid

    vid Peon

    Messages:
    209
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm sorry I don't understand, do you want to redirect user after upload is completed?
     
    vid, Dec 2, 2006 IP
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #3
    
    /*
     Send location headers
    */
    header("location: $done_page");
    
    /*
     Print meta refresh tags
    */
    echo "<meta http-equiv=\"refresh\" content=\"2;url=$done_page\">";
    
    PHP:
    I'm assuming you have a way of parsing the xml and extracting the done_page url from it....you're more likely to have better luck with meta refresh, that is unless all processes are handled before the first <html> tag or the first time php echos, drawback of using meta refresh in the middle of the page is the css will no longer be valid, but then that won't matter as ppl won't be sticking around
     
    krakjoe, Dec 2, 2006 IP
  4. 3l3ctr1c

    3l3ctr1c Peon

    Messages:
    380
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    "I'm sorry I don't understand, do you want to redirect user after upload is completed?"

    yes to the done page.


    krakjoe: Thanks I`ll try that and yes all the php functions are done before the first <html> tags itself.
     
    3l3ctr1c, Dec 3, 2006 IP
  5. TatiAnA

    TatiAnA Active Member

    Messages:
    1,103
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    78
    #5
    Meta redirects are strongly discouraged. IMO.
     
    TatiAnA, Dec 4, 2006 IP
  6. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #6
    ^^Why's that ? it's valid xhtml as long as it's before </head>....
     
    krakjoe, Dec 5, 2006 IP