I am currently working on a form I need a few things from this form. First of all here is the link to what I have so far... ( http://www.triplesource.net/php/Decal%20Offer.html ) And posted below is the code for ( submit.php ) Now the first part of the form is just a HTML page with an action pointing to ( SUBMIT.php )
Now a problem I am having is one the e-mailing... the whole form to me... but also befor that I think I should say I have * as in indicator to the user that those fields must be filled in... how ever my code doesnt not stop them with an error message because I am not sure how to set up the right ( IF statment.)
Another issue on this form is I do not nor have I ever had someone upload a photo... I put the (BROWSE) box in place.. but I need to make it so they can only pick a GIF,JPG,TIF,PDF ,PSD, and so on any image format... that is one issue... 2nd with that is that I want the image to be displayed on the (submit.php) page and show them also once they have hit submit I am wanting the form infomation to be sent to my e-mail adress with the picture as well.. would you please be able to help me with this.???
I am very new to php/MySQL I also have another very big question but I will save it for another threed another project.... That I am trying to pull off... Thank you!
Now a problem I am having is one the e-mailing... the whole form to me... but also befor that I think I should say I have * as in indicator to the user that those fields must be filled in... how ever my code doesnt not stop them with an error message because I am not sure how to set up the right ( IF statment.)
Another issue on this form is I do not nor have I ever had someone upload a photo... I put the (BROWSE) box in place.. but I need to make it so they can only pick a GIF,JPG,TIF,PDF ,PSD, and so on any image format... that is one issue... 2nd with that is that I want the image to be displayed on the (submit.php) page and show them also once they have hit submit I am wanting the form infomation to be sent to my e-mail adress with the picture as well.. would you please be able to help me with this.???
I am very new to php/MySQL I also have another very big question but I will save it for another threed another project.... That I am trying to pull off... Thank you!
Code:
<html>
<head>
<title>Free Windshield Decal Offer</title>
<script language="JavaScript">
<!--
function FP_preloadImgs() {//v1.0
var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}
function FP_swapImg() {//v1.0
var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
elm.$src=elm.src; elm.src=args[n+1]; } }
}
function FP_getObjectByID(id,o) {//v1.0
var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
return null;
}
// -->
</script>
</head>
<body onload="FP_preloadImgs(/*url*/'Images/button14.gif',/*url*/'Images/button15.gif')">
<?php
$headers = "From: MySite@mycom.com";
$to = "you@yoursite.com";
$subj = "Here is your html";
$body = "This form needs to be sent to my e-mail!!!";
if (!mail($to, $subj, $body, $headers))
echo 'Error';
else
echo 'Message sent';
?>
<div align="center">
<table border="0" id="table1">
<tr>
<td width="727" colspan="2">
<p align="center"><b><font size="2" face="Tahoma">Thank you, Your
Application will be processed in 24 to 48 hours.</font></b><hr size="1" color="#C0C0C0"></td>
</tr>
<tr>
<td width="727" colspan="2" align="center"><b>
<font face="Tahoma" size="2">You submitted the following
information:</font></b></td>
</tr>
<tr>
<td width="367" height="21" align="center">
<p align="right"><b><font face="Tahoma" size="2">
Select Vehicle Type:</font></b></td>
<td align="left">
<p align="left"> [PHP];<?php echo htmlspecialchars($_POST['Select']); ?></td>
</tr>
<tr>
<td width="367" align="center">
<p align="right"><b><font face="Tahoma" size="2">Street:</font></b></td>
<td align="left">
<p align="left"> [PHP];<?php echo ($_POST['Mailing']); ?></td>
</tr>
<tr>
<td width="367" align="center">
<p align="right"><b><font size="2" face="Tahoma">City:</font></b></td>
<td width="360" align="left">
 [PHP];<?php echo ($_POST['City']); ?></td> </tr>
<tr>
<td width="367" align="center">
<p align="right"><b><font size="2" face="Tahoma">State:</font></b></td>
<td width="360" align="left">
[PHP]<?php echo ($_POST['State']); ?></td> </tr>
<tr>
<td width="367" align="center">
<p align="right"><b><font size="2" face="Tahoma">Zip/Postal Code:</font></b></td>
<td width="360" align="left">
 [PHP];<?php echo ($_POST['Zip']); ?></td> </tr>
<tr>
<td width="367" align="center">
<p align="right"><b><font face="Tahoma" size="2">
E-Mail Address:</font></b></td>
<td width="360" align="left">
<p align="left">
 [PHP];<?php echo ($_POST['E-mail']); ?> </td> </tr>
<tr>
<td width="367" align="center">
<p align="right"><b><font face="Tahoma" size="2">
Copy of your aFe
purchase invoice:</font></b></td>
<td align="left">
<p align="left"> <?php echo ($_POST['FileToUpload']); ?></td>
</tr>
<tr>
<td width="367" valign="top" align="center">
<p align="right"><b><font face="Tahoma" size="2">Testimonial:</font></b></td>
<td width="360" align="left">
<p align="left"> <?[PHP]php echo ($_POST['Testimonial']); ?><p align="left"> <p align="left"> <p align="left"> </td>
</tr>
<tr>
<td width="367" valign="top" align="center">
<p align="right"><b><font face="Tahoma" size="2">Questions/Comments:</font></b></td>
<td width="360" align="left">
<p align="left">
 [PHP];<?php echo ($_POST['Questions']); ?><p align="left"> <p align="left">
<p align="left">
</td>
</tr>
<tr>
<td width="727" colspan="2" align="center">
<hr size="1" color="#C0C0C0"></td>
</tr>
<tr>
<td colspan="2">
<p align="center"><a href="http://afefilters.com/">
<img border="0" id="img1" src="Images/button13.gif" height="20" width="100" alt="Home page" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'Images/button14.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'Images/button13.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'Images/button15.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'Images/button14.gif')" fp-style="fp-btn: Simple Line 1; fp-font-style: Bold; fp-transparent: 1" fp-title="Home page"></a></p>
</tr> </table>
</div>
</body>
</html>
Comment