JStyl Posted July 25, 2011 Share Posted July 25, 2011 Small intro: I am NOT a programer but either lucky/smart enough to have created a website and wrote majority of html code. I have exhausted my knowledge and research skills and have been smacked around for the past week on something that I am sure is simple for someone. I need help with my process.php file coding and or what ever other files are involved in capturing my html applications form data/ image upload and sending it to my email address. I have been able to receive the email with subject and from populated, but not getting message body information to populate. Could someone please look at this php file below and explain to me how to create the code needed(highlight it please and in layman terms) so I can see where I went wrong. :'( ... <?php include("global.inc.php"); $errors=0; $error="The following errors occured while processing your form input.<ul>"; pt_register('POST','BirthDate'); pt_register('POST','FirstName'); pt_register('POST','LastName'); pt_register('POST','AliasAKA'); pt_register('POST','ContactNumber'); pt_register('POST','Besttimetocall'); pt_register('POST','EmailAddress'); pt_register('POST','Howdidyouhearaboutus'); $1PictureUpload=$HTTP_POST_FILES['1PictureUpload']; $2PictureUpload=$HTTP_POST_FILES['2PictureUpload']; $PictureUpload=$HTTP_POST_FILES['PictureUpload']; pt_register('POST','Describeyourselfin3wordorless'); if($BirthDate=="" || $FirstName=="" || $LastName=="" || $AliasAKA=="" || $ContactNumber=="" || $Besttimetocall=="" || $1PictureUpload=="" || $2PictureUpload=="" ){ $errors=1; $error.="<li>You did not enter one or more of the required fields. Please go back and try again."; } if(!is_uploaded_file($HTTP_POST_FILES['1PictureUpload']['tmp_name'])){ $error.="<li>The file, ".$HTTP_POST_FILES['1PictureUpload']['name'].", was not uploaded!"; $errors=1; } if(!is_uploaded_file($HTTP_POST_FILES['2PictureUpload']['tmp_name'])){ $error.="<li>The file, ".$HTTP_POST_FILES['2PictureUpload']['name'].", was not uploaded!"; $errors=1; } if($HTTP_POST_FILES['PictureUpload']['tmp_name']==""){ } else if(!is_uploaded_file($HTTP_POST_FILES['PictureUpload']['tmp_name'])){ $error.="<li>The file, ".$HTTP_POST_FILES['PictureUpload']['name'].", was not uploaded!"; $errors=1; } if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){ $error.="<li>Invalid email address entered"; $errors=1; } if($errors==1) echo $error; else{ $image_part = date("h_i_s")."_".$HTTP_POST_FILES['1PictureUpload']['name']; $image_list[16] = $image_part; copy($HTTP_POST_FILES['1PictureUpload']['tmp_name'], "files/".$image_part); $image_part = date("h_i_s")."_".$HTTP_POST_FILES['2PictureUpload']['name']; $image_list[17] = $image_part; copy($HTTP_POST_FILES['2PictureUpload']['tmp_name'], "files/".$image_part); $image_part = date("h_i_s")."_".$HTTP_POST_FILES['PictureUpload']['name']; $image_list[18] = $image_part; copy($HTTP_POST_FILES['PictureUpload']['tmp_name'], "files/".$image_part); $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); $message="Birth Date: ".$BirthDate." First Name: ".$FirstName." Last Name: ".$LastName." Alias AKA: ".$AliasAKA." Contact Number: ".$ContactNumber." Best time to call: ".$Besttimetocall." Email Address: ".$EmailAddress." How did you hear about us: ".$Howdidyouhearaboutus." 1 Picture Upload: ".$where_form_is."files/".$image_list[16]." 2 Picture Upload: ".$where_form_is."files/".$image_list[17]." Picture Upload: ".$where_form_is."files/".$image_list[18]." Describe yourself in 3 word or less: ".$Describeyourselfin3wordorless." "; $message = stripslashes($message); mail("myemail@mydomain.com","Application Submitted at your website", $message ,"From: phpFormGenerator"); $make=fopen("admin/data.dat","a"); $to_put=""; $to_put .= $BirthDate."|".$FirstName."|".$LastName."|".$AliasAKA."|".$ContactNumber."|".$Besttimetocall."|".$EmailAddress."|".$Howdidyouhearaboutus."|".$where_form_is."files/".$image_list[16]."|".$where_form_is."files/".$image_list[17]."|".$where_form_is."files/".$image_list[18]."|".$Describeyourselfin3wordorless." "; fwrite($make,$to_put); header("Refresh: 0;url=http://www.mydomain.com/thankyou.html"); ?><?php } ?> Hope I dont get in trouble for posting all that... Quote Link to comment https://forums.phpfreaks.com/topic/242794-need-coding-help-webform-app-dataupload-capture-to-email/ Share on other sites More sharing options...
AyKay47 Posted July 25, 2011 Share Posted July 25, 2011 holy small text batman! Quote Link to comment https://forums.phpfreaks.com/topic/242794-need-coding-help-webform-app-dataupload-capture-to-email/#findComment-1247000 Share on other sites More sharing options...
dcro2 Posted July 25, 2011 Share Posted July 25, 2011 Can you post what pt_register() does? Also, use or around your code. Quote Link to comment https://forums.phpfreaks.com/topic/242794-need-coding-help-webform-app-dataupload-capture-to-email/#findComment-1247065 Share on other sites More sharing options...
JStyl Posted July 26, 2011 Author Share Posted July 26, 2011 Sorry I was not able to locate a file named pt_register or anything related with register as part of the name. Please continue helping! Quote Link to comment https://forums.phpfreaks.com/topic/242794-need-coding-help-webform-app-dataupload-capture-to-email/#findComment-1247286 Share on other sites More sharing options...
AyKay47 Posted July 26, 2011 Share Posted July 26, 2011 dcro2 is referring to the custom function that you have specified in your code...pt_register() Quote Link to comment https://forums.phpfreaks.com/topic/242794-need-coding-help-webform-app-dataupload-capture-to-email/#findComment-1247293 Share on other sites More sharing options...
JStyl Posted July 26, 2011 Author Share Posted July 26, 2011 okay thanks. I used a program called phpFormGenerator to create the application and it created all the coding. To my understanding pt_register is a old version of the way $_POST is now used. I could be way wrong but here is something else that I found.. on a site call stackoverflow.com "What pt_regsiter does is allow you export an individual variable from one of these arrays into the global scope. So instead of writing global $HTTP_SERVER_VARS global $php_self; $php_self = $HTTP_SERVER_VARS['PHP_SELF'] You could write. pt_register('SERVER','PHP_SELF'); And you'd have a $php_self variable in the global scope." ???? Quote Link to comment https://forums.phpfreaks.com/topic/242794-need-coding-help-webform-app-dataupload-capture-to-email/#findComment-1247335 Share on other sites More sharing options...
JStyl Posted July 28, 2011 Author Share Posted July 28, 2011 IS there anyone that could please assist with this issue. :'( I really need to get this page to work correctly as soon as possible. :-\ Quote Link to comment https://forums.phpfreaks.com/topic/242794-need-coding-help-webform-app-dataupload-capture-to-email/#findComment-1248696 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.