eingabefeld , kein übergabe von Value / Text

Nabi

Erfahrenes Mitglied
hi everyone , sorry cant explane well in German .. the Problem is , I'm trying to get the value of an input field to send it to another site for process and from there to an email ,
the input field is a part of a Form , the input-field is called 'namesender' (see the Image) and suppose to have a value when someone writes something in that field this value should be sent to 'form.php' by the submit button which has the following code :

Code:
on (release){
	var fss=_root.namesender.text;
	getURL("form.php","_self","POST");
}

in the site 'form.php' I wrote the following code:

Code:
<?php
    $empfaenger = "myemail@yahoo.com"; 
    $betreff = "Neue Frage eingegangen"; 
    $from = "From: Website <myemail@yahoo.com>"; 
    
    $txt  = "Name: ".$_REQUEST['fss']."\n"; 
    $txt .= "Vorname: ".utf8_decode($_POST['vorname'])."\n"; 
    $txt .= "Tel. ".utf8_decode($_POST['tel'])."\n"; 
    $txt .= "Email: ".utf8_decode($_POST['email'])."\n"; 
    $txt .= "Nachricht: ".utf8_decode($_POST['nachricht'])."\n";
       
    mail($empfaenger, $betreff, $txt, $from); 
?>

now lets forget about the other values of the form .. lets constrate on 'fss' it is not having its real value .. its not having the text writting in 'namesender' , I get the following in the email :

Name:
Vorname:
Tel.
Email:
Nachricht:

why Name is Empty ?
 

Anhänge

  • Screen 00044.jpg
    Screen 00044.jpg
    73,1 KB · Aufrufe: 15
Zuletzt bearbeitet:
Hi,
why are you posting here if you are not so familiar with the german language? I am sure there are loads of good englisch Flash-forums.

However; you are not really sending the var fss to the php-script - just initializing it and then opening the php via getURL does not at all fulfill that purpose. What you are going to have to do is create a LoadVars()-Object, save the variables into it and then send it to your php-script:

Code:
myLV = new LoadVars();
myLV.fss = =_root.namesender.text;
myLV.send("form.php");

I am not too sure about the number of parameters needed for the LoadVars.send-function.. but I am pretty sure it's just the path to your php. Might be that you have to add a "POST" or "GET" into the brakets.

Greetings
jens

And... why are you using german script with german var-names and a tutorials.de-account with >190 posts if you are only speaking english?
 
Zuletzt bearbeitet:
just initializing it and then opening the php via getURL does not at all fulfill that purpose
By the way: it should, if the variable was a member of the lokal timeline. You declared it in a local event-procedure, where the getURL-method doesn't find ist.

I am not too sure about the number of parameters needed for the LoadVars.send-function
I am: Its three - destination, target and method:
Code:
loadvars.send("script.php", "_blank", "POST");

However, i would suggest to use the LoadVars.sendAndLoad method, wich doesn't open a new window (if your php-script just sends a mail, you don't really need a new window):
Code:
loadvars.sendAndLoad("script.php", loadvars, "POST");
The third parameter ist the callback-objekt: The output of the target-script will be transmitted to this object. You can use the LoadVars.onLoad method to acces these informations.

regards
.
 
it did not work :

Code:
on (release){
	
	myLV = new LoadVars();
myLV.namesender =_root.namesender.text;
myLV.sendAndLoad("form.php",myLV,"POST");
}

PHP:
<?php
    $empfaenger = "myemail@yahoo.com"; 
    $betreff = "Neue Frage eingegangen"; 
    $from = "From: Website <myemail@yahoo.com>"; 
    
    $txt  = "Name: ".$_REQUEST['namesender']."\n"; // without .utf8_decode
    $txt .= "Vorname1: ".utf8_decode($_POST['namesender'])."\n"; //with
    $txt .= "Vorname: ".utf8_decode($_POST['vorname'])."\n"; 
    $txt .= "Tel. ".utf8_decode($_POST['tel'])."\n"; 
    $txt .= "Email: ".utf8_decode($_POST['email'])."\n"; 
    $txt .= "Nachricht: ".utf8_decode($_POST['nachricht'])."\n";
       
    mail($empfaenger, $betreff, $txt, $from); 
?>
recieved email :
Name:
Vorname1:
Vorname:
Tel.
Email:
Nachricht:

I did the following test , it works :
Code:
on (release){
	
	myLV = new LoadVars();
myLV.namesender ="Hallo";

myLV.sendAndLoad("form.php",myLV,"POST");
}

recieved email :
Name: Hallo
Vorname1:
Vorname:
Tel.
Email:
Nachricht:

Now how can I let it read my input text in the 'FORM' ?
 

Anhänge

  • Screen 00046.jpg
    Screen 00046.jpg
    9,7 KB · Aufrufe: 11
Zuletzt bearbeitet:
Hi,
why are you posting here if you are not so familiar with the german language? I am sure there are loads of good englisch Flash-forums.
[...]
And... why are you using german script with german var-names and a tutorials.de-account with >190 posts if you are only speaking english?
Und wieso sind die vorhergehenden 193 Postings in (doch eigentlich ziemlich gutem) Deutsch? :confused:

Am Rande ... wieso eigentlich $_REQUEST?
Möglicherweise stimmt auch der Pfad _root.namesender nicht.
 
Zuletzt bearbeitet:
Lustig und ich dachte schon eine Engländerin würde die Hilfe von tutorials.de benötigen.
Würde mich nicht wundern wenn es sich bis dorthin rumgesprochen hätte.
 
You should check what this gives out:

Code:
trace(_root.namesender.text);

Based on this information you could guess where the issue occurs and then search for it in the right places. If that doesn't work out you should post the *.fla.

Irgendwie lustig in Englisch zu schrieben.
 
Based on this information you could guess where the issue occurs and then search for it in the right places

The Result is : ' Undefined' this is really strange , the whole time I've been dealing with
a variable that does not Exist :confused:

if you see the Image above , you'll see that I gave that field an Instance name , I mean 'namesender' so why 'Undefined' :confused:
 

Neue Beiträge

Zurück