Hot to make a save.php to post the content

Discussion in 'PHP' started by Website_Playboy, Dec 10, 2010.

  1. #1
    I have a .swf and it posts the content to save.php however i dont have a save.php prepared. I donno what code i should put in the save.php to get the content posted there.

    Here is the content post code from .swf

    loc3 = new flash.net.URLRequestHeader("Content-type", "application/x-www-form-urlencoded");
                    (loc4 = new flash.net.URLRequest(p.rooturl + "/save.php?name=" + arg2 + "&type=" + arg1)).requestHeaders.push(loc3);
                    loc4.method = flash.net.URLRequestMethod.POST;
                    loc4.data = arg3;
                    flash.net.navigateToURL(loc4, "_self");
                    Close();
    Code (markup):
    what code i should put in the save.php to show the content sent from the above swf code?
     
    Website_Playboy, Dec 10, 2010 IP
  2. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #2
    
    <?php
    echo $_GET['name'].' '.$_GET['type'];
    ?>
    
    PHP:
     
    tvoodoo, Dec 10, 2010 IP
  3. Website_Playboy

    Website_Playboy Member

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    It gave me only this on a blank page

    MS_29281.jpg jpg

    "MS_29281" is the file name. I think there is something wrong with the code.
     
    Website_Playboy, Dec 10, 2010 IP
  4. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Yeah , your code...I only ouputed what you've asked me...
     
    tvoodoo, Dec 10, 2010 IP
  5. Website_Playboy

    Website_Playboy Member

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    Then is there a way to fix my code?
    I mean i just want it to post the picture on save.php
    I dont care about the name or type or whatever. I just need the picture to be posted. Do you think you can edit the code so i can recompile the swf?
     
    Website_Playboy, Dec 10, 2010 IP
  6. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Change path_to_picture/ to where your picture is relative to the save.php file.
    
    <?php
    echo '<img src="path_to_picture/'.$_GET['name'].'" border="0" />;
    ?>
    
    PHP:
     
    tvoodoo, Dec 10, 2010 IP
  7. Website_Playboy

    Website_Playboy Member

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #7
    Picture is coming from the computer. There is no temp folder either. I donno where the picture is coming from exactly.
    Everything is in the same folder.
     
    Website_Playboy, Dec 10, 2010 IP
  8. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #8
    So then remove path_to_picture/
     
    tvoodoo, Dec 10, 2010 IP
  9. Website_Playboy

    Website_Playboy Member

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #9
    I get this now...

    Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/site/public_html/deneme/save.php on line 2
    
    Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /home/site/public_html/deneme/save.php on line 2
    Code (markup):
    I have this on save.php

    <?php
    echo '<img src="'.$_GET['name'].'" border="0" />;
    ?>
    Code (markup):
     
    Website_Playboy, Dec 10, 2010 IP
  10. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #10
    echo '<img src="'.$_GET['name'].'" border="0" />';

    add a ' before ;
     
    tvoodoo, Dec 10, 2010 IP
  11. Website_Playboy

    Website_Playboy Member

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #11
    /deneme/save.php?name=MS_29310.jpg&type=jpg
    adress gave me an empty picture which is like a broken link with this page source code

    <img src="MS_29310.jpg" border="0" />
    Code (markup):
    Thas it.
     
    Website_Playboy, Dec 10, 2010 IP
  12. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #12
    So what do you think this means ? Don't expect everything given to you up front....
    This means that the picture MS_29310.jpg is NOT in the same folder as save.php.
     
    tvoodoo, Dec 10, 2010 IP
  13. Website_Playboy

    Website_Playboy Member

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #13
    Well there is no folder. I ll tell you what is in the folder.
    the swf, index.html and save.php
    the swf gets the image from your computer for temporary and after you edit the pic you press on save and it extracts the picture to save.php
    I dont think it puts the picture to anywhere.
     
    Website_Playboy, Dec 10, 2010 IP
  14. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #14
    I don't understand what you want anymore... To show a picture on the screen or to copy a picture from somewhere ?
     
    tvoodoo, Dec 10, 2010 IP
  15. Website_Playboy

    Website_Playboy Member

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #15
    To show the picture on save.php Because after you click on save in swf it should send the picture to save.php but save.php doesnt grab it.
     
    Website_Playboy, Dec 10, 2010 IP