SunQuest
           Windows Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsWindows Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old December 12th, 2002, 11:00 AM
[.RO]NIN [.RO]NIN is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Romania
Posts: 5 [.RO]NIN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to [.RO]NIN
win nt 40 + apache::can't read php generated variables into Flash MX

Hello everybody!
This is my first message on this forum.
I have the following problem:
System:
Win nt 4.0 service pack 6
Apache
PHP
MySQL
Flash MX
The problem:
reading php generated variables from Flash
The php script looks like this:


PHP:--------------------------------------------------------------------------------

<?
$result = $HTTP_GET_VARS['input'] +1;
print "result=$result";
?>

--------------------------------------------------------------------------------

When I enter in the browser's address window the following address:
<http://localhost/phpFile?input=100>
In the Browser window appears:
<result=101>

So the php works fine with Apache!
The next step would be to read the "result" variable into Flash, using the "loadVars()" method.
This part doesn't work.

What could be the problem?
Win NT permissions?
Apache settings?
PHP .ini settings?
I hope that somebody has the answer.

Reply With Quote
  #2  
Old December 13th, 2002, 12:57 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Quote:
What could be the problem?
Win NT permissions?
Apache settings?
PHP .ini settings?

none of the above. maybe you have to send a "\n" at the end of the string.
i cannot remember, but i succeeded only after some tries too...

how do you access the variable in flash? Can we have 2 lines of code from you (the line with loadVars() and the line where you want to work with the variable...)
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old December 13th, 2002, 08:53 AM
[.RO]NIN [.RO]NIN is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Romania
Posts: 5 [.RO]NIN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to [.RO]NIN
I have this code in the first( and only) frame of the .fla file:
------------------------------------------------------------------------------
_global.input=100;
lvObj=new LoadVars();
lvObj.input=_global.input;
lvObjRec=new LoadVars();
lvObjRec.onLoad=function(){
_root.result_tf.text=this.result;
}
lvObj.sendAndLoad("http://localhost/myFlashPhpTest/process.php" + "?" + lvObj.toString(), lvObjRec);
stop();
------------------------------------------------------------------------------
note: _root.result_tf is a text field in the same frame.

My php looks like this:
-----------------------------------------------------------------------------
<?
if(isset($HTTP_GET_VARS['input']))
{
$result = $HTTP_GET_VARS['input'] +1;
print "result=$result\n";
}
?>
-----------------------------------------------------------------------------

How must I modify my php file?
I have attached the files to this message.
Please test them on your computer.
Attached Files
File Type: zip myflashphptest.zip (4.2 KB, 245 views)

Reply With Quote
  #4  
Old December 13th, 2002, 12:26 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
did they make a new script language for Flash MX? I only have Flash 5, but there is no predefined "LoadVars" object.

i only have a "loadVariables()" command, that will be used like this:
Code:
loadVariables("http://localhost/myFlashPhpTest/process.php?input="+String(_global.input), 0);
result_tf.text=result;

... are you running your flash inside the browser and on the same domain?
you cannot do cross-domain access nor can you run the file from your harddisk. it has to be loaded from http://localhost too.

Reply With Quote
  #5  
Old December 13th, 2002, 02:30 PM
freddydoesphp freddydoesphp is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2000
Posts: 669 freddydoesphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Try using

$_REQUEST instead of $HTTP_GET_VARS for some reason PHP does not pick up vars sent from Flash in a GET string using HTTP_GET_VARS.

Its happened to me before.

M. Hirsch I suggest you pick up MX, the new objects and event handlers blow the socks off 5.

Reply With Quote
  #6  
Old December 13th, 2002, 03:27 PM
freddydoesphp freddydoesphp is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2000
Posts: 669 freddydoesphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Quote:
did they make a new script language for Flash MX? I only have Flash 5, but there is no predefined "LoadVars" object.

i only have a "loadVariables()" command, that will be used like this:


code:--------------------------------------------------------------------------------
loadVariables("http://localhost/myFlashPhpTest/process.php?input="+String(_global.input), 0);
result_tf.text=result;
--------------------------------------------------------------------------------

... are you running your flash inside the browser and on the same domain?
you cannot do cross-domain access nor can you run the file from your harddisk. it has to be loaded from http://localhost too.



M. Hirsch he stated at the top he has Flash MX, most of the stuff you stated can be done in Flash MX including cross-domain stuff. And running it from your harddisk.

Also your code probably will not work as expected since you need to detect when the variables have been loaded before you can assign the value of one to a text field.

Reply With Quote
  #7  
Old December 14th, 2002, 03:45 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
ok, you convinced me that i need this MX too. On monday iŽll ask my boss

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsWindows Help > win nt 40 + apache::can't read php generated variables into Flash MX


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway