Exporting to a textfile (or any other if better)

im kind of confused why i havent gotten any help :puzzle:

so i thought maybe you guys didnt want to take the time to download the sourcesā€¦ so here they areā€¦

I have a button in my movie that contains this:
[AS]loadVariablesNum (ā€œsave.phpā€, 0, ā€œPOSTā€);[/AS]

and then a php file that contains this:


<? php
$test = $_POST["test"];
$filname = './test.txt';
$fp = fopen($filname, 'w');
fputs($fp, "$test");
fclose($fp);
?>

im not extremely familiar w/ php so idk what the prob isā€¦ help plz :slight_smile:

it is a holiday, in the US anyway, most people are with family and away from their computers.

patience is a virtue.

it isnā€™t personal, the right person will answer when they get a chance.

Rev

hehe i knowā€¦ i was just trying to help out and save some folks some time :smiley: happy holidays! (the birth of Jesus is a world wide holiday ;))

*Originally posted by Riddler? *
**hehe i knowā€¦ i was just trying to help out and save some folks some time :smiley: happy holidays! (the birth of Jesus is a world wide holiday ;)) **

[s] really?

I hadnā€™t noticedā€¦ [/s]

You were the one wondering, outloud, why your thread hadnā€™t been answered, so donā€™t get snippy to meā€¦

Rev

haha i have no idea what your problem is, but im sorry if i offended you ā€¦ lol that really caught me off guardā€¦

(the birth of Jesus is a world wide holiday )

wasnā€™t a smartass comment? you were the one who put the :wink: wink guy next to your obvious statement.

You are not well known here, so how am I supposed to know your intent? You sounded impatient, so I made an attempt to calm your eagerness. You then make a snippy remark with a wink, and now you say it caught you off guard?

BTW - if you want to use a flash footer, it needs to be 300 wide x 60 tall maximum. Just an FYI

Rev

thanx man for the helpā€¦ something must be wrong w/ my sytax because the sig still isnt working

and im sorry, i wasnt being sarcastic or smart toward youā€¦ sorry you took it that way. i was just being happy, not a butt

cool.

I think it is the swf=" thingā€¦

(Iā€™m not really a programmer, more of an animater from way back)

there is a sticky somewhere about thisā€¦

Rev

Adding flash footers
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=12

thanks claudioā€¦

Rev

No problem Rev :slight_smile:

w00t thanx guys!! now for the real problemā€¦ hehe

Vash is the php guyā€¦ this may be better in the server side forum.

Rev

I had thought so too after i posted hereā€¦ is there anyway it can be moved so i dont have to double post?

consider it movedā€¦

Rev

*Originally posted by reverendflash *
**consider it movedā€¦

Rev **

this thread isnā€™t the only thing moved :slight_smile:

http://kirupa.rastardesigns.com/exporter.zip

Norieā€¦ I LOVE YOU :D!!! Thank you sooo muchā€¦ and also big props for explaining that code too!!! thank you! i will try to remember to show you guys my finished product when im done :D!!!

hey thanx for the awesome help, but after I got to messing w/ it I hit another small problem that my lack on PHP knowledged kept me from fixingā€¦ here is my updated file i made to suit me:

<?php
$filename = 'news.txt';
$tag = 'news=';
$somecontent = $_POST['news'];

// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {


    if (!$handle = fopen($filename, 'w')) {
         print "Cannot open file ($filename)";
         exit;
    }

    // Write $somecontent to our opened file.
    if (!fwrite($handle, $tag)) {
       print "Cannot write to file ($filename)";
        exit;
    }
    
//    print "news=$tag";
    
    fclose($handle);

    if (!$handle = fopen($filename, 'a')) {
         print "Cannot open file ($filename)";
         exit;
    }

    // Write $somecontent to our opened file.
    if (!fwrite($handle, $somecontent)) {
       print "Cannot write to file ($filename)";
        exit;

    print "news=$somecontent";
    
    fclose($handle);
    
}
    
    print "news=$somecontent";
					
} else {
    print "news=The file $filename is not writable";
}
?>

my prob is that if i enter something into my text box that has an apostrophe of quotation PHP automatically adds the backslash for the obvious reasonsā€¦ but this messes me up when I try to use my HTML tags or just apostropheā€™s in my lil example thing at www.jayhayes.no-ip.com/Jay/crap/thingy.html thanx again guys

<?php
//return var 'news'
$filename = 'news.txt';
$somecontent = stripslashes($_POST['news']);

// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {


    if (!$handle = fopen($filename, 'w')) {
         print "news=Cannot open file ($filename)";
         exit;
    }

    // Write $somecontent to our opened file.
    if (!fwrite($handle, $tag)) {
       print "news=Cannot write to file ($filename)";
        exit;
    }
    
//    print "news=$tag";
    
    fclose($handle);

    if (!$handle = fopen($filename, 'a')) {
         print "news=Cannot open file ($filename)";
         exit;
    }

    // Write $somecontent to our opened file.
    if (!fwrite($handle, $somecontent)) {
       print "Cannot write to file ($filename)";
        exit;

    print "news=$somecontent";
    
    fclose($handle);
    
}
    
    print "news=$somecontent";
                    
} else {
    print "news=The file $filename is not writable";
}
?>

haha man you rawk :slight_smile: thanx again soo much! :smiley: