Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variables to php

Status
Not open for further replies.

snakemanbry

Programmer
Jul 28, 2004
2
US
Am having problem with passing variables to my php script. Works fine if I just use the form to pass to the php but when it's at the 92nd frame, it just won't pass. Any suggestions/help?
 
What do you mean?
Can you show the actionscript you use in order to pass the vars to php?

and what are you trying to do in frame 92?


 
Frame 92 is just where the form pops in. It just seems like something isn't in place then to make it work. Here's the actionscript. Thanks...

submitURL = "processform.php";
Selection.setFocus(name_txt);
function onClick(btn)
{
trace("onClick " + btn._name);
if ( btn == pg1next ) {
gotoAndPlay("pg2"); // go to pg 2 and play
}
}

onReset = function () {
// text fields
firstname_txt = "";
lastname_txt = "";
address_txt = "";
city_txt = "";
zip_txt = "";
phone_txt = "";
email_txt = "";
// listbox
state.setSelectedIndex(null);
// result box
result_txt = "";
}

function onSubmit() {
formData = new LoadVars();
// Initialize formData variables:
formData.firstname_txt = "";
formData.lastname_txt = "";
formData.address_txt = "";
formData.city_txt = "";
formData.state_txt = "";
formData.zip_txt = "";
formData.phone_txt = "";
formData.email_txt = "";
// Gather the order information into a LoadVars instance.
formData.firstname_txt = firstname_txt.getValue();
formData.lastname_txt = lastname_txt.getValue();
formData.address_txt = address_txt.getValue();
formData.city_txt = city_txt.getValue();
formData.state_txt = state_txt.getValue();
formData.zip_txt = zip_txt.getValue();
formData.phone_txt = phone_txt.getValue();
formData.email_txt = email_txt.getValue();

// Create another LoadVars instance to receive the server's reply
replyData = new LoadVars();
// Initialize reply variable.
replyData.firstname_txt = "";
replyData.lastname_txt = "";
replyData.address_txt = "";
replyData.city_txt = "";
replyData.state_txt = "";
replyData.zip_txt = "";
replyData.phone_txt = "";
replyData.email_txt = "";
// Specify a function to call when this new instance receives the reply.
replyData.onLoad = handleReply;
// Submit the order data
formData.sendAndLoad(submitURL, replyData, "post");
// Tell the user what's happening.
result_txt.text = "Submitting order, please wait...";
}
function handleReply(success) {
if (success) {
result_txt.text = "Your info was received:\n";
result_txt.text += "First Name: " + replyData.firstname_txt + newline;
result_txt.text += "Last Name: " + replyData.lastname_txt + newline;
result_txt.text += "Address: " + replyData.address_txt;
} else {
result_txt.text = "There was a problem receiving your info. The server may be down or not responding.";
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top