Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-11-2007, 11:22 AM   #1
dreimann
Registered User
 
Join Date: Oct 2006
Posts: 33
Default send variable to php

Hi
I whant to send variable to php. I am new in php. So I have simple stupid question. Can I save variable in php file or I need to save it in .txt file as string. I don`t whant to save it on database.
I ask like this becouse tutorials I read has // Printing out the variables. from php ( but I whant to save) or
or save in text file like this
//Open a file in write mode
$fp = fopen("myText1.txt", "w");
if(fwrite($fp, $toSave)) echo "writing=Ok&";
else echo "writing=Error&"
fclose($fp);

but this code don`t work, error in line / fclose($fp); /

I know how to load variable to Flash but there is so few tutorials about send. and each of them are different.
In flash I whant to send a variable from _parent movie and then load variable in _root movie
I am trying to learn using flash and php without xml.
dreimann is offline   Reply With Quote
Old 02-13-2007, 07:34 PM   #2
FREAKNUT
Registered User
 
Join Date: Nov 2006
Posts: 84
Default

Quote:
//Open a file in write mode
$fp = fopen("myText1.txt", "w");
if(fwrite($fp, $toSave)) echo "writing=Ok&";
else echo "writing=Error&"
fclose($fp);
I'm not the most adept at PHP, but I think it's supposed to look like this:
PHP Code:
//Open a file in write mode
$fp fopen("myText1.txt""w");
if(
fwrite($fp$toSave)) {echo "writing=Ok&";}
else {echo 
"writing=Error&"}
fclose($fp); 
You need the curly braces. Hope that helps!
FREAKNUT is offline   Reply With Quote
Old 02-19-2007, 01:10 PM   #3
dreimann
Registered User
 
Join Date: Oct 2006
Posts: 33
Default

HI
Thenk`s for help. Now looks like something works.
php code open a new windows with:
Code:
writing=Ok&

But I expect to see a status.text = "Submited data was saved" in flash.
Code:
btn.onPress = function(){
        SData.Title = Title.text
        SData.send("save.php", SData, "POST")
    }
 SData = new LoadVars()
    SData.onLoad = function(){       
       if(this.writing=="Ok") {
            gotoAndStop(1)
            status.text = "Submited data was saved"
       } else(status.text = "Error in saving submitted data")
    }
status.text area is empty. and also a text file myText1.txt is empty
In the same flash file function should load saved text, but it dosnt, :
Code:
poga.onPress = function () {
myData = new LoadVars();
myData.onLoad = function() {
Title.text = this.Title1;
};
myData.load("myText1.txt"); 
}
dreimann is offline   Reply With Quote
Old 02-22-2007, 04:48 AM   #4
mary_ftech
Registered User
 
Join Date: Aug 2006
Location: India
Posts: 74
Default try this....

instead of send use sendandload
mary_ftech is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Discovering PHP variable in HTML page lokki Server-Side Scripting 5 11-11-2006 07:14 PM
Send variable to PHP file without pop up mmm..pi..3.14.. Server-Side Scripting 9 05-31-2004 03:06 PM
problem with variable passed to PHP flyrod Server-Side Scripting 7 12-23-2002 06:11 PM
how to store a php returned variable? jkd77 ActionScript 1.0 (and below) 1 12-18-2001 12:26 AM
Writing to a file (locally only) isleshocky77 ActionScript 1.0 (and below) 13 08-23-2001 02:43 AM


All times are GMT. The time now is 07:51 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.