Contact Forms Issue

Discussion in 'PHP' started by GAdsense, Nov 11, 2008.

  1. #1
    I have several contact forms in php. I edit a specific script for every contact form I use. Its a script in php.

    Contact forms works but the problem if I use the html coding to align things and add beauty to it, nothing more than spacing, bold and line breaks. It works fine in gmail but it shows complete emails with html coding at

    like this
    
    <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
    <html>
    <head>
    <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-9'>
    <title>Untitled Document</title>
    <style type='text/css'>
    <!--
    body,td,th {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
    }
    body {
            margin-left: 0px;
            margin-top: 0px;
    }
    -->
    </style></head>
    <body>
    <table width='560' border='0' cellspacing='1' cellpadding='1'>
      <tr>
        <td colspan='2'>Email form filled by : <strong>dfsdfcfasasdasdas </strong></td>
      </tr>
      <tr>
        <td width='142'>Name : </td>
        <td width='411'><strong>dfsdfcfasasdasdas</strong></td>
      </tr>
      <tr>
        <td>Phone no : </td>
        <td><strong>12312312as</strong></td>
      </tr>
      <tr>
        <td>Email address: </td>
        <td><strong>asdasdas@adasdas.com</strong></td>
      </tr>
      <tr>
        <td>Best time to call: </td>
        <td><strong>Noon-3PM</strong></td>
      </tr>
      <tr>
        <td>Interest:</td>
        <td><strong>Shutters,Woven Woods,Horizontal blinds,Vertical blindsadasdasd</strong></td>
      </tr>
      <tr>
        <td height='59'>Comment:</td>
        <td><strong>asdasdasdadcasca</strong></td>
      </tr>
    </table>
    </body>
    </html> 
    HTML:
    The php I am using is

    <?php
    
      // if submitted form process and send mail
    
    ////variables
    
    $name=$_REQUEST['name'];
    
    $phone=$_REQUEST['phone'];
    
    $email=$_REQUEST['email'];
    
    $time=$_REQUEST['time'];
    
    $chkInterest=implode(',', $_REQUEST['chkInterest']);
    
    $comments=$_REQUEST['comments'];
    
    if(isset($_REQUEST['otherInterest'])):
    
    $otherint=$_REQUEST['otherInterest'];
    
    //else:
    
    //$otherint="No";
    
    endif;
    
      //////////////html format
    
    $html="<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
    
    <html>
    
    <head>
    
    <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-9'>
    
    <title>Untitled Document</title>
    
    <style type='text/css'>
    
    <!--
    
    body,td,th {
    
    	font-family: Arial, Helvetica, sans-serif;
    
    	font-size: 12px;
    
    }
    
    body {
    
    	margin-left: 0px;
    
    	margin-top: 0px;
    
    }
    
    -->
    
    </style></head>
    
    ";
    
    $html.="
    <body>
    
    <table width='560' border='0' cellspacing='1' cellpadding='1'>
    
      <tr>
    
        <td colspan='2'>Email form filled by : <strong>".$name." </strong></td>
    
      </tr>
    
      <tr>
    
        <td width='142'>Name : </td>
    
        <td width='411'><strong>".$name."</strong></td>
    
      </tr>
    
      <tr>
    
        <td>Phone no : </td>
    
        <td><strong>".$phone."</strong></td>
    
      </tr>
    
      <tr>
    
        <td>Email address: </td>
    
        <td><strong>".$email."</strong></td>
    
      </tr>
    
      <tr>
    
        <td>Best time to call: </td>
    
        <td><strong>".$time."</strong></td>
    
      </tr>
    
      <tr>
    
        <td>Interest:</td>
    
        <td><strong>".$chkInterest.$otherint."</strong></td>
    
      </tr>
    
      <tr>
    
        <td height='59'>Comment:</td>
    
        <td><strong>".$comments."</strong></td>
    
      </tr>
    
    </table>
    
    </body>
    
    </html>
    
    ";
    
    $subject="Sample Check";
    
    $headers="Content-type: text/html; charset=iso-8859-1\r\n";
    
    $headers .= "From:" . $email."\r\n";
    
    mail("adnanqaizar@gmail.com",$subject, $html,$headers);
    
    header("Location: thankyou.htm");
    
    ?>
    PHP:
    Do you know why is this happening?
     
    GAdsense, Nov 11, 2008 IP
  2. srikanthever4u

    srikanthever4u Greenhorn

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    use php mailer u r problem solved
     
    srikanthever4u, Nov 11, 2008 IP
  3. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175