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

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&"

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
Registered User
Join Date: Nov 2006
Posts: 84

//Open a file in write mode
$fp = fopen("myText1.txt", "w");
if(fwrite($fp, $toSave)) echo "writing=Ok&";
else echo "writing=Error&"
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");
fwrite($fp$toSave)) {echo "writing=Ok&";}
else {echo 
You need the curly braces. Hope that helps!
FREAKNUT is offline   Reply With Quote
Old 02-19-2007, 01:10 PM   #3
Registered User
Join Date: Oct 2006
Posts: 33

Thenk`s for help. Now looks like something works.
php code open a new windows with:

But I expect to see a status.text = "Submited data was saved" in flash.
btn.onPress = function(){
        SData.Title = Title.text
        SData.send("save.php", SData, "POST")
 SData = new LoadVars()
    SData.onLoad = function(){       
       if(this.writing=="Ok") {
            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, :
poga.onPress = function () {
myData = new LoadVars();
myData.onLoad = function() {
Title.text = this.Title1;
dreimann is offline   Reply With Quote
Old 02-22-2007, 04:48 AM   #4
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

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 09:14 PM.

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.