attachemnt to Email..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I want to attach the file which is selected in file field.. the code 
i am using is given below....  please help me ... 

Note:-post and get methods will not work on my hosting....










<?php
$error="";

@$send=$HTTP_POST_VARS['Submit'];
@$to="satya@xxxxxxxxxxxxxxx";
if (isset($send))
{
	@$sub="Introduction";
	@$from="webmaster@xxxxxxxxxxxxxxx";
	@$msg=$HTTP_POST_VARS['firstname'].
		  $HTTP_POST_VARS['secondname'].
		  $HTTP_POST_VARS['doj'].
		  $HTTP_POST_VARS['dob'].
		  $HTTP_POST_VARS['dept'].
		  $HTTP_POST_VARS['desig'].
		  $HTTP_POST_VARS['repaut'].
		  $HTTP_POST_VARS['resp'].
		  $HTTP_POST_VARS['nationality'].
		  $HTTP_POST_VARS['education'].
		  $HTTP_POST_VARS['languages'].
		  $HTTP_POST_VARS['ambition'].
		  $HTTP_POST_VARS['likes'].
		  $HTTP_POST_VARS['dislikes'].
		  $HTTP_POST_VARS['sports'].
		  $HTTP_POST_VARS['hobby'].
		  $HTTP_POST_VARS['pemp'].
		  $HTTP_POST_VARS['pdes'].
		  $HTTP_POST_VARS['emailid'].
		  $HTTP_POST_VARS['self'].
		  $HTTP_POST_VARS['file'].
		  $HTTP_POST_VARS['phone'].
		  $HTTP_POST_VARS['add'];

	$headers='MIME-version:1.0'."\r\n";
	$headers.='Content-Type:text/html;Charset:iso-8859-1'."\r\n";
	
	$headers.='To:'.$to."\r\n";
	//echo $headers.='From:'.$from."\r\n";
	
	if ($to=="" || $sub==""||$from==""||$msg)
	{
		$error="Fill all the fields.";
	}
	
	if (mail($to,$sub,$msg,$headers))
	{
		//header("location:reply.php");
		echo "Mail has been sent.";
		
	}
	else {
		echo "Sorry";
	}
}

?>
<title>Introduction Form</title>
<style type="text/css">
<!--
body {
	background-color: #E6E6E6;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
body,td,th {
	font-size: medium;
	color: #555555;
	font-family: Courier New, Courier, monospace;
}
.style3 {font-family: "Courier New", Courier, monospace; font-size: 
small; }
.style4 {font-size: small}
-->
</style>
</head>
 
<body>
<script type='text/JavaScript' src='./scw.js'></script>

<form action="" method="post" enctype="multipart/form-data" 
name="form1" id="form1">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    
    <tr>
      <td><table width="700" border="0" align="center" 
cellpadding="0" cellspacing="0">
        <tr>
          <td width="20%">&nbsp;</td>
          <td width="80%"><table width="500" border="1" 
cellpadding="1" cellspacing="1" bordercolor="#FF9866" 
bgcolor="#FFFFFF">
              <tr>
                <td colspan="2"><object classid="clsid:D27CDB6E-AE6D-
11cf-96B8-444553540000" 
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swfl
ash.cab#version=7,0,19,0" width="100%" height="65">
                  <param name="movie" value="banner.swf" />
                  <param name="quality" value="high" />
                  <embed src="banner.swf" width="100%" height="65" 
quality="high" 
pluginspage="http://www.macromedia.com/go/getflashplayer"; 
type="application/x-shockwave-flash"></embed>
                </object></td>
              </tr>
              <tr>
                <td width="199" bgcolor="#F0F2FB"><span 
class="style4"></span></td>
                <td width="488" bgcolor="#F7F7F7"><span 
class="style4"></span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style3">First 
Name</span></td>
                <td bgcolor="#F7F7F7"><input name="firstname" 
type="text" id="firstname" accesskey="0" tabindex="0" 
size="35" /></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style3">Second 
Name </span></td>
                <td bgcolor="#F7F7F7"><input name="secondname" 
type="text" id="secondname" accesskey="1" tabindex="1" 
size="35" /></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style4">Date Of 
Joining </span></td>
                <td bgcolor="#F7F7F7"><input name="doj" id="Input" 
onmouseover="scwShow(this,this);" 
      value="02 Jun, 1950" size="35" /></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style3">Date Of 
Birth </span></td>
                <td bgcolor="#F7F7F7"><input name="dob" id="date4" 
onmouseover="scwShow(this,this);" 
      value="02 Jun, 2006" size="35" />                </td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style4">Department</span></td>
                <td bgcolor="#F7F7F7"><input name="dept" type="text" 
id="dept" size="35" /></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style3">Designation</span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <input name="desig" type="text" id="desig" 
size="35" />
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style3">Reporting 
Authorty </span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <input name="repaut" type="text" id="repaut" 
size="35" />
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style3">Responsibililities </span></td>
                <td bgcolor="#F7F7F7"><span class="style4">
                  <textarea name="resp" cols="27" 
id="resp"></textarea>
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style4">Nationality</span></td>
                <td bgcolor="#F7F7F7"><input name="nationality" 
type="text" id="nationality" size="35" /></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style4">Education</span></td>
                <td bgcolor="#F7F7F7"><input name="education" 
type="text" id="education" size="35" /></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style4">Languages 
Known </span></td>
                <td bgcolor="#F7F7F7"><input name="languages" 
type="text" id="languages" size="35" /></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style3">Ambition</span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <textarea name="ambition" cols="27" 
id="ambition"></textarea>
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style3">Likes</span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <textarea name="likes" cols="27" 
id="likes"></textarea>
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style3">Dislikes</span></td>
                <td bgcolor="#F7F7F7"><span class="style4">
                  <textarea name="dislikes" cols="27" 
id="dislikes"></textarea>
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style3">Favourite 
Sprots </span></td>
                <td bgcolor="#F7F7F7"><input name="sports" 
type="text" id="sports" size="35" /></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style3">Hobby's 
</span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <input name="hobby" type="text" id="hobby" 
size="35" />
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style3">Previous 
</span><span class="style4">Employer </span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <input name="pemp" type="text" id="pemp" 
size="35" />
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style3">Designation <br />
                  (Previous Company) </span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <input name="pdes" type="text" id="pdes" 
size="35" />
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style3">Preffered 
E-Mail ID </span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <input name="emailid" type="text" id="emailid" 
size="35" />
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style3">About Your 
Self </span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <textarea name="self" cols="27" 
id="self"></textarea>
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span 
class="style3">Photograph</span></td>
                <td bgcolor="#F7F7F7"><span class="style3">
                  <input name="file" type="file" size="21" />
                </span></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style4">Phone No 
</span></td>
                <td bgcolor="#F7F7F7"><input name="phone" type="text" 
id="phone" size="35" /></td>
              </tr>
              <tr>
                <td bgcolor="#F0F2FB"><span class="style4">Permanant 
Address </span></td>
                <td bgcolor="#F7F7F7"><span class="style4">
                  <textarea name="add" cols="27" id="add"></textarea>
                </span></td>
              </tr>
              <tr>
                <td height="10" colspan="2"></td>
              </tr>
              <tr>
                <td colspan="2"><table width="120" border="0" 
align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="17%" class="style4"><input 
type="submit" name="Submit" value="Submit" action="new.php"  
method="post"  /></td>
                      <td width="10%" class="style4">&nbsp;</td>
                      <td width="73%" class="style4"><input 
type="reset" name="Submit2" value="Reset" /></td>
                    </tr>
                </table></td>
              </tr>
          </table></td>
        </tr>
      </table></td>
    </tr>
  </table>
</form>









PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-objects/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:php-objects-digest@xxxxxxxxxxxxxxx 
    mailto:php-objects-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux