fredley Posted December 14, 2006 Share Posted December 14, 2006 I normally make flash websites, and I use the in-built system for sending form data, which uses a php file. I have a large form to make, and need an html replica. I just need to know how to send the data from the html form to the php file I already have. Most online guides I have read rely on their own php files, I need to be able to use the same one, or at least output the same information (I have written a program to extract the data at the other end).ThanksTom[code]<?php$i1 = $HTTP_POST_VARS['input1'];$i2 = $HTTP_POST_VARS['input2'];$i3 = $HTTP_POST_VARS['input3'];$i4 = $HTTP_POST_VARS['input4'];$i5 = $HTTP_POST_VARS['input5'];......$i48 = $HTTP_POST_VARS['input48'];$i49 = $HTTP_POST_VARS['input49'];$i50 = $HTTP_POST_VARS['input50'];$message = stripslashes($message);$sendTo = "[email protected]";$subject = "Worker Application";$msg_body = "%%var1%% $i1 %%var2%% $i2 %%var3%% $i3 %%var4%% $i4 %%var5%% $i5 %%var6%% $i6 %%var7%% $i7 %%var8%% $i8 %%var9%% $i9 %%var10%% $i10 %%var11%% $i11 %%var12%% $i12 %%var13%% $i13 %%var14%% $i14 %%var15%% $i15 ... ... %%var48%% $i48 %%var49%% $i49 %%var50% $i50";$header_info = "From: ".$i1." <".$i2.">";mail($sendTo, $subject, $msg_body, $header_info);?>[/code] Link to comment https://forums.phpfreaks.com/topic/30695-solved-simple-request/ Share on other sites More sharing options...
Daniel0 Posted December 14, 2006 Share Posted December 14, 2006 Try this: [code]<?php$msg_body = null;foreach($_POST as $key => $value){ $msg_body .= "Var '{$key}': {$value}\n";}mail('[email protected]','Worker Application',$msg_body,"From: {$name} <{$email}>\n\r");?>[/code]But where does $name and $email come from?? Link to comment https://forums.phpfreaks.com/topic/30695-solved-simple-request/#findComment-141450 Share on other sites More sharing options...
fredley Posted December 14, 2006 Author Share Posted December 14, 2006 Sorry, edited it, all should be fine now.Tom Link to comment https://forums.phpfreaks.com/topic/30695-solved-simple-request/#findComment-141454 Share on other sites More sharing options...
JasonLewis Posted December 15, 2006 Share Posted December 15, 2006 try Daniel0's code. sept wouldnt that also grab the submit button if the OP named and gave it a value, or wouldnt it just grab it anyway... Link to comment https://forums.phpfreaks.com/topic/30695-solved-simple-request/#findComment-141482 Share on other sites More sharing options...
fredley Posted December 15, 2006 Author Share Posted December 15, 2006 I'm not sure, I'm pretty new to all this. Is it just me or could Daniel0's code put things in different orders, depending on whether all fields were filled? What I really want to know is what to put into my HTML file, I know I have the <form method="POST" action=""> line, but I don't know how to get that to post to my php file. Tom Link to comment https://forums.phpfreaks.com/topic/30695-solved-simple-request/#findComment-141659 Share on other sites More sharing options...
JasonLewis Posted December 16, 2006 Share Posted December 16, 2006 in the action part, enter the link to your php file. but Daniel0's code is basicly grabbing all information in the $_POST array and displaying it, or using it as variables... Link to comment https://forums.phpfreaks.com/topic/30695-solved-simple-request/#findComment-142344 Share on other sites More sharing options...
fredley Posted December 16, 2006 Author Share Posted December 16, 2006 Yeh thanks, just worked that out, all is fine now!Thanks for your help.Tom Link to comment https://forums.phpfreaks.com/topic/30695-solved-simple-request/#findComment-142353 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.