PDA

View Full Version : Stoopid php....


maxx
04-09-2003, 09:41 PM
Okay, I thought I had this down. I've got the following code in my Flash MX movie - logMem = new LoadVars();
logMem.onLoad = function (){
getURL("loginPage.php","_blank");
}
...
logIn.onRelease = function(){
logMem.user=logName;
logMem.pass=acct;
logMem.sendAndLoad("loginPage.php", logMem, "POST");
} where logName and acct are variables set in a form in the Flash movie. logIn is the instance name of the submit button. The "loginPage.php" is as follows:<?php
print $_POST["user"];
?>Flash should pass 'user' as an index in the logMem object to the POST globals in the PHP, right? 'Cause all I get is "Notice: Undefined index: user in c:\inetpub\wwwroot\md\loginPage.php on line 3" when the actual php page comes up.

Now, I've added a dynamic text box in the movie that (when the logIn.onRelease function is called) echos (via the .text property) the variable logMem.user - this works fine, except that the field is filled in as I type, not after I click the submit button. And I still get an undefined index in $_POST at user.

I swear I had Flash and PHP talking nicely just last week. That'll tech me to clean out my harddrive.... shoot.

Anybody got any ideas on this one? Any help would be greatly appreciated.

DanSolo
04-09-2003, 10:04 PM
Suggestion: use PHP remoting :)

http://www.actionscript.org/tutorials/intermediate/PHP_Remoting/index.shtml

maxx
04-09-2003, 10:08 PM
Checkin' that out right now! So I take it it's not just me - php and Flash really don't get along all that well?

DanSolo
04-09-2003, 10:17 PM
It's not that they don't get along well, there are just easier ways to communicate with server-based languages in MX :D

maxx
04-09-2003, 10:40 PM
Downloading the php remoting now, but in the meantime - I mean, the code as written should work, right? Am I forgetting something way easy? I got php to talk to Flash a while ago, only thing is that I also had Flash talking to php. I swear it was the same stuff! It's just not working now. :mad:

DanSolo
04-09-2003, 10:44 PM
I think you were supposed to pass the variables using the getURL function, because the page is refreshing.

Alternatively, you can use a PHP function which changes the browser location.

-Dan

CyanBlue
04-10-2003, 07:45 AM
Works just fine on my end...

Check out my sample... ;)

CyanBlue
04-10-2003, 07:48 AM
Oh... If you say that sort of meaningless topic, Stoopid php...., one more time... I'll personally kick your butt!!! Use descriptive words that best describes your problem when you post so that other people can know what you are talking about... Alrighty??? ;) Just for the record... It is not the PHP that is stupid... It is gotta be something between your computer and the chair... I'm running away~~~~~~~~~~ :D

maxx
04-10-2003, 10:53 AM
Originally posted by CyanBlue
Oh... If you say that sort of meaningless topic, Stoopid php...., one more time... I'll personally kick your butt!!! Use descriptive words that best describes your problem when you post so that other people can know what you are talking about... Alrighty??? ;) please don't hurt maxx. maxx be good... Just for the record... It is not the PHP that is stupid... It is gotta be something between your computer and the chair... I'm running away~~~~~~~~~~ :D hmm... between the computer and the chair.... My keyboard's the problem? :D

Seriously, Cyan - I just downloaded your attachment to check out - thank you. (sorry about the thread title - tired and frustrated). And DanSolo - thanks for your help and for pointing me to the amfphp download - gonna be playing with that most of the day.

maxx
04-10-2003, 12:33 PM
Thanks for the file! Got me thinking in a slightly different direction that seems to be working! Thank you! More exclamation points!

seriously, thank you. the file does help.

CyanBlue
04-10-2003, 10:12 PM
No problem... Glad to be of your service... ;)

So... Put another penny into the piggy bank with my name on the belly... and send it to me when it goes to $100... :D

And, please call me CyanBlue, not Cyan or CB or Blue or whatever it is... I just hate people doing it... :(

maxx
04-10-2003, 11:42 PM
Originally posted by CyanBlue
No problem... Glad to be of your service... ;)

And again I say thank you..

So... Put another penny into the piggy bank with my name on the belly... and send it to me when it goes to $100... :D

Building quickly toward that... :D

And, please call me CyanBlue, not Cyan or CB or Blue or whatever it is... I just hate people doing it... :(

Duly noted. Won't happen again...

CyanBlue
04-10-2003, 11:44 PM
:D

Just out of curiosity... Where do you live??? You didn't specify it on the location of your profile... ;)

maxx
04-11-2003, 12:07 AM
Beach side of North Carolina. Why? Don't tell me I type with an accent, too... :p (sorry - transplanted northerner. Every morning I wake up and realize just how cold is it is where I used to live... heheheh...)

CyanBlue
04-11-2003, 12:16 AM
Nah... I was just worried if I have to do exchange all that foreigh currency to $$$...

Nah... I just happened to see you alot at the same time, so I have asked... ;) Not that far from VA then, eh???

maxx
04-11-2003, 12:28 AM
Not that far, no - 'course, I'm about as far south in North Carolina as you can get (about 45 minutes from the border with SC). Love this part of the country! :cool:

CyanBlue
04-11-2003, 12:30 AM
Still too cold on April though... :(

I'm about 15 minutes from the DC to the west...

maxx
04-11-2003, 12:54 AM
Not far at all. And actually, today .... shh - don't tell it - the sun came out for a bit for the first time all week. I felt a little like Erik the Viking - just sort of stood there and tried to figure out what it was at first. But yeah, it still pretty cold right now. Which means the ocean's not warming up, and I can't afford a new wetsuit yet, so the board's just gonna have to stay dry for a while. I think my wife might kill me if I don't blow off a little steam in the surf at some point soon.... :rolleyes: Gotta love computers and jobs and clients...

CyanBlue
04-11-2003, 02:49 AM
So, you surf, eh??? I don't... :D

I was living in Savannah, GA for four years before I came up to VA... Many people who lives there enjoyed surfing in late fall or early spring while it was still cold... I just didn't understand what the heck they were doing... :D But then, as long as there is something they enjoy... ;)

freddycodes
04-11-2003, 02:56 AM
I just got out of the water 30 minutes ago, but then again the water temp is 55 and the sun is shining where I live. Plus a small NW swell to make it quite fun.

maxx
04-11-2003, 03:01 AM
CyanBlue - I try to surf. I'm not good at it at all... But I like to practice...

freddycodes - grrr... It's getting to the time of season where we have no waves at all - we all kind of sit around and hope for a hurricane to come and park it just off the coast. Far enough out not to do any damage, but kick some fat swell to the beach! And 55 degrees... woof. I remember when I first moved here (12 years ago) from MI, that felt warm. Think my blood's thinned. Anyway, glad it was good for you! :D

CyanBlue
04-11-2003, 03:01 AM
Geez... Big America, eh??? lol...