Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question trying to open php file from javascript

    Hi guys i have an embedded game in an html (unity3D) and i am wanting to delete a file from my server.

    so at the moment i have a php file on my server and the html containing the javascript on my desktop.

    test.php
    PHP Code:
    <?php
    $conn 
    ftp_connect("ftp.domain.co.uk") or die("Could not connect");
    ftp_login($conn,"username","password");

    echo 
    ftp_delete($conn,"test.txt");

    ftp_close($conn);
    ?>
    I will out the correct domian name and username and password and this should delete a file named test.txt on my server.

    the problem i am having is calling this script from my javascript which is my main html:
    i have searched all over and found if i do this :
    Code:
    <script language="JavaScript">
            function DELETE_SERVER_FILE()
            {
                    dummyimage = new Image();
                    dummyimage.src ="http://www.domain.co.uk/test.php"
            }
    
    </script>
    But this is not working, can anyone help?

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •