Results 1 to 2 of 2

Thread: How to make Flash works with PHP to create TXT file?

  1. #1
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to make Flash works with PHP to create TXT file?

    so here goes,

    the point is, i have created an order form in flash cs3 with actionscript 3.0, and my lecture wants my flash to be working with PHP, so if i click the submit button, my flash will load the PHP file and created a .TXT file in the directory(offline) which includes the information of the order form!

    i've already research for this problem, but all i got is a script to send email from a form! i need something that can be working offline to show it to my lecture..

    maybe the php script would be something like this example,

    <?php
    $File = "YourFile.txt";
    $Handle = fopen($File, 'w');
    $Data = "Jane Doe\n";
    fwrite($Handle, $Data);
    $Data = "Bilbo Jones\n";
    fwrite($Handle, $Data);
    print "Data Written";
    fclose($Handle);
    ?>
    but i still need help from the master please! thanks!! i have to collect it tomorrow (GMT+7!) !! :worship:

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    First, people on this forum are not in the business of doing other's homework assignments. Perhaps, you should seek the advice of someone in your department for more tangible help than what I'll be giving.

    This really is two different operations. The first his the AS. The second is the PHP. There needs to be a AS bridge between the Flash app and the PHP script.

    The first thing you should do is write a PHP script that can write/edit a plain text file. You might be interested in this, this or this.

    Once you have that, replace the hardcoded values with variable names. Those variable names should correspond to the field names in your Flash app.

    Next, POST the values from Flash to the PHP. Some of the tutorials at gotoandlearn() should be of help (e.g. this and this).

    Finally, you'll need PHP to be able to demo this. That means you'll need a LAMP server of some sort - if you don't have something installed on your computer (WAMP, MAMP, XAMPP, etc..), you'll need to upload this online.

Bookmarks

Posting Permissions

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