Jump to content

form don't work


mariocesar

Recommended Posts

Why this form don't send the images, just the info arrives in the e-mail, here is the code

<?php

if(isset($_REQUEST['button_submit']))

{

if($_FILES['image']['name']!="")

{

	$ProDes=isset($_POST['product_desc'])?$_POST['product_desc']:'';

	$QanReq=isset($_POST['quantity_request'])?$_POST['quantity_request']:'';

	$ShipInf=isset($_POST['ship_inform'])?$_POST['ship_inform']:'';

	$Title=isset($_POST['title'])?$_POST['title']:'';

	$FirstName=isset($_POST['first_name'])?$_POST['first_name']:'';

	$LastName=isset($_POST['last_name'])?$_POST['last_name']:'';

	$Email=isset($_POST['email'])?$_POST['email']:'';

	$ConEmail=isset($_POST['confirm_email'])?$_POST['confirm_email']:'';

	$Phone=isset($_POST['phone'])?$_POST['phone']:'';

	$Mobile=isset($_POST['mobile'])?$_POST['mobile']:'';

	$Company=isset($_POST['company'])?$_POST['company']:'';

	$Website=isset($_POST['website'])?$_POST['website']:'';

	$Add1=isset($_POST['address1'])?$_POST['address1']:'';

	$Add2=isset($_POST['address2'])?$_POST['address2']:'';

	$City=isset($_POST['city'])?$_POST['city']:'';

	$State=isset($_POST['state'])?$_POST['state']:'';

	$Zip=isset($_POST['zip'])?$_POST['zip']:'';

	$Country=isset($_POST['country'])?$_POST['country']:'';

	$FindUs=isset($_POST['find_us'])?$_POST['find_us']:'';



	if(file_exists("productimages/".$_FILES['image']['name']))

		$msg="An image with this name already exsists . Please try with different image name for Product sample";



	else if($_FILES['image']['type']=="image/jpeg" or $_FILES['image']['type']=="image/gif" or $_FILES['image']['type']=="image/png")

	{

		 move_uploaded_file($_FILES['image']['tmp_name'],"productimages/".$_FILES['image']['name']);

		 $img="yes";

		$ImagePath='http://allstatedisplay.com/productimages/'.$_FILES['image']['name'];

	}



	else

	{

		 $msg.="Product sample first image is not a valid image type. Please choose JPG,GIF or PNG type file only";

		$img="No";

	}

}



if($_FILES['image1']['name']!="")

{



	if(file_exists("productimages/".$_FILES['image1']['name']))

	$msg="An image with this name already exsists. Please try with different image name for drwaing , picture etc.";

	else if($_FILES['image1']['type']=="image/jpeg" or $_FILES['image1']['type']=="image/gif" or $_FILES['image1']['type']=="image/png")

	{

		 move_uploaded_file($_FILES['image1']['tmp_name'],"productimages/".$_FILES['image1']['name']);

		 $img1="yes";

		$ImagePath1='http://allstatedisplay.com/productimages/'.$_FILES['image1']['name'];

	}



	else

	{

		 $msg.="Product sample second image is not a valid image type. Please choose JPG,GIF or PNG type file only";

		$img1="No";

	}



}

$temp='<p>Description of product:'.$ProDes.'</p>';



if( $img=="yes")

{



		$temp.='<p>Product Sample Image :

	</p><img src="'.$ImagePath.'" width="300"/>'."</p><p> If you are not seeing the image copy and paste the link below in your browser address to view the image: $ImagePath</p>";



}

if($img1=="yes")

{

	$temp.='<p>Attach file (Drawing, Picture etc.)

		</p><p><img src="'.$ImagePath1.'" width="300"/>'."</p><p> If you are not seeing the image copy and paste the link below in your browser address to view the image: $ImagePath1</p>";

}



$temp.='<p>Quantity Requested:'.$QanReq.'</p><p>Shipping information:'.$ShipInf.'</p><p><strong>Contact Information:</strong></p><p>Title:'.$Title.'</p><p>Name:'.$FirstName.' '.$LastName.'</p><p>Email:'.$Email.'</p><p>Phone No:'.$Phone.'</p><p>Mobile:'.$Mobile.'</p><p>Company / Organization:'.$Company.'</p><p>Website:'.$Website.'</p><p>Address 1:'.$Add1.'</p><p>Address 2:'.$Add2.'</p><p>City / Town:'.$City.'</p><p>State / Province:'.$Zip.'</p><p>Zip/Postal code:'.$State.'</p><p>Country:'.$Country.'</p><p>How did you find us:'.$FindUs.'</p>';



$subject="ADS Product Request"; /* change this! */ 



    $headers1  = 'MIME-Version: 1.0' . "\r\n";

	$headers1 .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

	$headers1 .= "From: ADS Product Request <www@ADS.com>" . "\r\n";	

	$headers  = 'MIME-Version: 1.0' . "\r\n";

	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

	//$headers .= 'Cc: niladri.debnath27@gmail.com' . "\r\n";

	$headers .= "From: ADS Product Request <www@ADS.com>" . "\r\n";	



	mail('mariovicuna@yahoo.com', $subject, $temp,$headers1);

	$mode='success';



}

?>

Link to comment
Share on other sites

here is the form:

<table cellpadding="2" cellspacing="0" align="center" width="80%">

<tr><td><?php echo $msg; ?></td></tr>

<TR>



          <TD vAlign=top align=left width="39%">Description of product:</TD>



          <TD width="61%" colspan="2" align=left vAlign=top><INPUT class=text_feild_query 



            id=product_desc name=product_desc></TD></TR> 

		<TR>



          <TD vAlign=top align=left>Product Sample (If available)<BR>Attach 



            file (Drawing, Picture etc.) <BR>of your products</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query_file 



            type=file name=image> <BR><INPUT class=text_feild_query_file 



            type=file name=image1></TD></TR>

		<TR>



          <TD vAlign=top align=left>Quantity Requested:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query 



            id=quantity_request name=quantity_request></TD></TR>

		<TR>



          <TD vAlign=top align=left>Shipping information:</TD>



          <TD colspan="2" align=left vAlign=top><SELECT class=drop_down_query 



            id=ship_inform name=ship_inform> <OPTION value=Sea 



              selected>Sea</OPTION> <OPTION 



        value=Air>Air</OPTION></SELECT></TD></TR>

	<TR>



    <TD class=home_title colSpan=3 align="left">Contact Information</TD>



  </TR>

	<TR>







          <TD vAlign=top align=left width="39%">*Title:</TD>



          <TD width="61%" colspan="2" align=left vAlign=top><SELECT class="drop_down_query required "



            id=title name=title  title="Please choose title."> <OPTION value="" selected>Title</OPTION> 



              <OPTION value=Mr.>Mr.</OPTION> <OPTION 



            value=Ms.>Ms.</OPTION></SELECT> </TD></TR>

		<TR>



          <TD vAlign=top align=left>*Name:</TD>



          <TD vAlign=top align=left><INPUT class="text_feild_query_sm required"



            id=first_name name=first_name title="Please enter name."></TD>

          <TD vAlign=top align=left><input class="text_feild_query_sm required"  



            id="last_name" name="last_name" title="Please enter last name." /></TD>

		</TR>

		<TR>



          <TD vAlign=top align=left>*Email:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required email" id=email 



            name=email title="Please enter a valid email"></TD></TR>



        <TR>



          <TD vAlign=top align=left>*Confirm email:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required email" 



            id=confirm_email name=confirm_email></TD></TR>



        <TR>



          <TD vAlign=top align=left>*Phone No:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required" id=phone 



            name=phone title="Please enter phone no."></TD></TR>



        



        <TR>



          <TD vAlign=top align=left>*Company / Organization:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required" id=company 



            name=company title="Please enter company"></TD></TR>



        <TR>



          <TD vAlign=top align=left>Website:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=website 



            name=website></TD></TR>



        <TR>



          <TD vAlign=top align=left>*Address 1:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required" id=address1 



            name=address1 title="Please enter address1."></TD></TR>



        <TR>



          <TD vAlign=top align=left>Address 2:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=address2 



            name=address2></TD></TR>



        <TR>



          <TD vAlign=top align=left>City / Town:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=city 



            name=city></TD></TR>



        <TR>



          <TD vAlign=top align=left>State / Province:</TD>



          <TD colspan="2" align=left vAlign=top><select name="zip" id="zip"  class="ordertextin"> 



          <option selected>Choose one </option> 



          <option value="AL">Alabama</option> 



          <option value="AK">Alaska</option> 



          <option value="AZ">Arizona</option> 



          <option value="AR">Arkansas</option> 



          <option value="CA">California</option> 



          <option value="CO">Colorado</option> 



          <option value="CT">Connecticut</option> 



          <option value="DE">Delaware</option> 



          <option value="FL">Florida</option> 



          <option value="GA">Georgia</option> 



          <option value="GU">Guam</option> 



          <option value="HI">Hawaii</option> 



          <option value="ID">Idaho</option> 



          <option value="IL">Illinois</option> 



          <option value="IN">Indiana</option> 



          <option value="IA">Iowa</option> 



          <option value="KS">Kansas</option> 



          <option value="KY">Kentucky</option> 



          <option value="LA">Lousiana</option> 



          <option value="ME">Maine</option> 



          <option value="MD">Maryland</option> 



          <option value="MA">Massachusetts</option> 



          <option value="MI">Michigan</option> 



          <option value="MN">Minnesota</option> 



          <option value="MS">Mississippi</option> 



          <option value="MO">Missouri</option> 



          <option value="MT">Montana</option> 



          <option value="NE">Nebrasca</option> 



          <option value="NV">Nevada</option> 



          <option value="NB">New Brunswick</option> 



          <option value="NH">New Hamshire</option> 



          <option value="NJ">New Jersey</option> 



          <option value="NM">New Mexico</option> 



          <option value="NY">New York</option> 



          <option value="NC">North Carolina</option> 



          <option value="ND">North Dakota</option> 



          <option value="OH">Ohio</option> 



          <option value="OK">Oklahoma</option> 



          <option value="OR">Oregon</option> 



          <option value="OTHER">Other</option> 



          <option value="PA">Pennsylvania</option> 



          <option value="PR">Puerto Rico</option> 



          <option value="RI">Rhode Island</option> 



          <option value="SC">South Carolina</option> 



          <option value="SD">South Dakota</option> 



          <option value="TN">Tennessee</option> 



          <option value="TX">Texas</option> 



          <option value="UT">Utah</option> 



          <option value="VT">Vermont</option> 



          <option value="VI">Virgin Islands</option> 



          <option value="VA">Virginia</option> 



          <option value="WA">Washington</option> 



          <option value="DC">Washington DC</option> 



          <option value="WI">Wisconsin</option> 



          <option value="WY">Wyoming</option> 



          <option value="YK">Yukon</option> 



        </select></TD></TR>



        <TR>



          <TD vAlign=top align=left>*Zip/Postal code:</TD>



          <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=state 



            name=state></TD></TR>



        <TR>



          <TD vAlign=top align=left>*Country:</TD>



          <TD colspan="2" align=left vAlign=top><input class="text_feild_query required" id=country 



            name=country title="Please enter country."></TD>

        </TR>

		<TR>



    <TD align="left">How did you find us</TD>



    <TD colspan="2" align="left"><SELECT class=drop_down_query id=find_us name=find_us> 



        <OPTION value="Search Engine" selected>Search Engine</OPTION> <OPTION 



        value="Sponsored link">Sponsored link</OPTION> <OPTION 



        value="Print Advt.">Print Advt.</OPTION> <OPTION 



        value=Referral>Referral</OPTION> <OPTION 



      value=Others>Others</OPTION></SELECT></TD></TR>

  

  <tr><td colspan="3" height="10"></td></tr>

  <TR>



    <TD> </TD>



    <TD colspan="2" align="left"><INPUT class=button id=button_submit type=submit value=Submit name=button_submit> <INPUT type=reset value=Reset> </TD></TR>

</table>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.