Post mit AS 3.0 senden
-
27-10-2019 - |
Frage
Ich möchte ein Formular in Flash einreichen und den Benutzer an eine andere Seite in HTML/PHP senden und die Postinformationen auf dieser Seite erhalten. Wie kann ich das machen?
Lösung
// create a URLRequest object with the target URL:
var url : String = 'newpage.html';
var urlRequest : URLRequest = new URLRequest(url);
// create a URLVariables object and add all the values you want to send with their identifiers:
var urlVariables : URLVariables = new URLVariables();
urlVariables['formfieldId'] = 'formfieldValue';
// add the urlVariables to the urlRequest
urlRequest.data = urlVariables;
// set the method to post (default is GET)
urlRequest.method = URLRequestMethod.POST;
// use navigateToURL to send the urlRequest, use '_self' to open in the same window
navigateToURL(urlRequest, '_self');
Andere Tipps
Verwenden Sie das URLREQUEST Klasse
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow