Jump to content

can someone help me fix this short code ?


onyx23

Recommended Posts

hello everyone !

well i have a flash website and i have a contact page in it, and with this php code will send emails from my website to my email.

but when i get them they look like this.

 

0>

Content-type: text/html; charset=iso-8859-1

 

<html><head><title>Onyx Contact letter</title></head><body><br>Name:

<b>your full name: test nam </b><br>Phone: <b>your

telephone:808-322-2922</b><br>0</b><br><hr><br>your message: test msg?<br></body></html>

 

my php contact.php is this one. can someone tell me what am i doin wrong ?

 

<?php

 

    $your_full_name = $_GET['name'];

    $your_telephone = $_GET['phone'];

    $email_address = $_GET['email'];

    $your_message = $_GET['message'];

   

    $recipient_email = "[email protected]";

    $subject = "from" . $e-mail_address;

    $headers = "From" . $your_full_name . "<". $e-mail_address . ">\n";

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

   

    $content = "<html><head><title>Onyx Contact letter</title></head><body><br>"; 

    $content .= "Name: <b>" . $your_full_name . "</b><br>";

    $content .= "Phone: <b>" . $your_telephone . "</b><br>";

    $content .= "E-mail: <b>" . $your_e-mail . "</b><br><hr><br>";

    $content .= $your_message;

    $content .= "<br></body></html>";

 

    mail($recipient_email,$subject,$content,$headers);

?>

<html>

    <body bgcolor="#282E2C">

        <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">

            Your message was sent. Thank you.

        </div>

    </body>

</html>

<script>resizeTo(300, 300)</script>

 

 

Link to comment
https://forums.phpfreaks.com/topic/56872-can-someone-help-me-fix-this-short-code/
Share on other sites

hai,

 

--Modify the code---

1.

// To send HTML mail, the Content-type header must be set

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

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

 

2.$ok=mail($recipient_email,$subject,$content,$headers);

  if($ok==1){

 

  $msg=" Your message was sent Thank you.";}else{

  $msg=" Error";

  }

 

3.

<html>

    <body bgcolor="#282E2C">

        <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">

          <?=$msg;?>

        </div>

    </body>

</html>

<script>resizeTo(300, 300)</script>

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.