I have a form now that when submitted it uses the getURL function to post to a php page and then loads a blank confirmation page. I would like to use my existing form and submit button to somehow submit the form via a php script but then load an internal flash page (I think maybe using LoadVars and sendAndLoad).
Here is the existing code:
SEND BUTTON AS
FRAME ASCode:on (release) { for (i=1; i<_parent.fields_descriptions.length; i++) { if (_parent[_parent.fields_descriptions[i][1]]!=_parent.fields_descriptions[i][2]) { this[_parent.fields_descriptions[i][1]]=_parent[_parent.fields_descriptions[i][1]]+"&777&"+_parent.fields_descriptions[i][2]; } _parent.reset_txt(_parent["t"+i], _parent.fields_descriptions[i][1], _parent.fields_descriptions[i][2]); } this.recipient=_parent.rec; i=undefined; getURL("contact."+_parent.serv, "_blank", "POST"); }
PHP CODECode:rec="email@address.com"; serv="php"; var fields_descriptions= Array ("", Array("t1", "your_name", "Your Name:"), Array("t2", "your_email", "Your Email:"), Array("t3", "telephone", "Your Phone:"), Array("t4", "message", "Your Message:"), ); function reset_txt(name,name2,value) { path=eval(_target); path[name2]=value; this[name].onSetFocus=function() { path=eval(_target); if(path[name2]==value) { path[name2]="";} } this[name].onKillFocus=function() { path=eval(_target); if(path[name2]=="") { path[name2]=value;} } } for (i=1; i<=fields_descriptions.length; i++) { reset_txt("t"+i, fields_descriptions[i][1], fields_descriptions[i][2]); }
Code:[/C<?php Error_Reporting(E_ALL & ~E_NOTICE); while ($request = current($_REQUEST)) { if (key($_REQUEST)!='recipient') { $pre_array=split ("&777&", $request); $post_vars[key($_REQUEST)][0]=preg_replace ("/<[^>]*>/", "", $pre_array[0]); $post_vars[key($_REQUEST)][1]=preg_replace ("/<[^>]*>/", "", $pre_array[1]); } next($_REQUEST); } reset($post_vars); $subject="From ".$post_vars['your_name'][0] ; $headers= "From: ".$post_vars['your_email'][0] ."\n"; $headers.='Content-type: text/html; charset=iso-8859-1'; $message=''; while ($mess = current($post_vars)) { if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) { $message.="<strong>".$mess[1]."</strong> ".$mess[0]."<br>"; } next($post_vars); } mail($_REQUEST['recipient'], $subject, " <html> <head> <title>Thank You</title> </head> <body> <br> ".$message." </body> </html>" , $headers); ?> <html> <head> <title></title> </head> //HTML CODE </html>






Bookmarks