;

PDA

Click to See Complete Forum and Search --> : send form data


blanius
10-06-2004, 10:44 AM
I'm using the send form data function to send email form data to a PHP file that in turn sends response.

It works however it is loading the actual php page rather than staying on the flash page and recieving the data.

How do I do it so that it only gets the data and not load a new page?

necromanthus
10-06-2004, 10:56 AM
Download & study this (simple) example:
http://necromanthus.com/KoolMoves/GuestBook.html
cheers

FLASHPULSE
10-06-2004, 10:56 AM
Go to KoolSource and look at "Mail Form". It's in the script area.

blanius
10-06-2004, 11:06 AM
thanks guys

blanius
10-13-2004, 12:22 PM
Can't get this to work......

First let me say that I've built email and guestbook systems with another program and very familiar with PHP...

for testing I've made a simple PHP that just echos back a variable with some text added


<?php //test.php


echo "&result=".$_GET[me]."_Sentback";

?>


I also used POST for a while as well

now in KM I've got a dynamic text box wich gets set to something and a button that has

loadVariables("test.php",0);

and have tried
this.loadVariables("test.php","GET")

and
_root.loadVariables("test.php","GET")

so that I can see that the data was both sent and recieved I set a funtion to update the text, here is the AS in the first frame

result="I've been set"
me="bret"

funtion updateText(){
txt1=result
}

setInterval( updateText, 1000 );

exporting as 6 with compatability on.

Nothing seems to happen when the button is pressed.

This all leads back to the way I want to do the email form.. I send the raw data to the PHP where I can use

if (!$name){//empty name?
$response="nameBlank";
}


if (!eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$",$email)){//Valid Email?
$response="BadEmail";
}

if (!$message){//empty message?
$response="messageBlank";
}

if (!$response){//All is well if we haven't set a response by this point

$response="success";
}
being able to use eregi to find out if message is OK to really send and send feedback to the flash movie that it was indeed sent, rather than assume it was.

FLASHPULSE
10-13-2004, 01:10 PM
I'm not good with AS but your button needs an on(release) action.

blanius
10-13-2004, 02:03 PM
no not that type of button doesn't (Pretty Sure) it is one of the Interface components and shows it as onClick action

blanius
10-13-2004, 05:46 PM
I'm at the end of my rope!

tmoore935
10-13-2004, 08:40 PM
Can you get the mailform from Koolksource to Work?

blanius
10-13-2004, 09:51 PM
Hadn't actually tried to run it. But I am using the same code. But I suppose for fun I should try it on my server.

blanius
10-13-2004, 10:05 PM
dang it that demo works fine.... What the heck!

I'm using the same syntax.

tmoore935
10-13-2004, 10:56 PM
Originally posted by blanius
dang it that demo works fine.... What the heck!

I'm using the same syntax.

The mailform is converted from a flash 5 program about two years ago. It worked until a new version of koolmoves came out and then was updated/fixed. I know if the chmods are wrong or you upload the php correctly you will have problems, but you probable now this already. I would have to guess that their is an extra period somewere or something.

Also for some reason I am unable to download from koolsource???

blanius
10-14-2004, 10:41 AM
Ok it turns out it had to do with my variable names and dynamic text elements.

It's a bit confusing regarding how the variables are sent back and by exporting as V6 with backward compatiblity I just name the text fields as the variable names and it works.

The thing that made this hard was not being able to get feedback and the idiosyncrosisy of KM that differ from what I've gotten accustom to.

Thanks eveyone for they feedback here.

FLASHPULSE
10-14-2004, 11:20 AM
Originally posted by tmoore935
Also for some reason I am unable to download from koolsource???

Just tried it and the download worked fine. Let me know if you are still having issues.

tmoore935
10-14-2004, 01:18 PM
Originally posted by FLASHPULSE
Just tried it and the download worked fine. Let me know if you are still having issues.

I can dowmload from work with win 98 but I cannot from home which is xp. Might be service pack 2. I will try again this eve.:confused: