|
 |
|
รบกวนช่วยดู code ให้ด้วยครับ ไม่รู้ว่ามีปัญหาตรงไหนถึงส่งข้อมูลหน้าเว็บมาที่ gmail ไม่หมดครับ |
|
 |
|
|
 |
 |
|
พอดีผมเขียน code การกรอกข้อมูลหน้าเว็บแล้วให้ส่งมาที่ gmail ปัญหาอยู่ที่ส่งมามีแต่ชื่อกับเบอร์ติดต่อ ข้อมูลอย่างอื่นไม่มาครับ แล้วผมต้องแก้ code ตรงไหนครับ ส่วน code ที่ผมเขียน
Code (PHP)
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<?php
?>
<style type="text/css">
<!--
.style2 {
color: #FF0000;
font-weight: bold;
}
.style5 {
font-size: 9px;
color: #006600;
font-family: Verdana, Tahoma, "MS Sans Serif";
}
-->
</style>
<?
switch ($type)
{
case 1 :
$t = "รถเก๋ง";
break;
case 2 :
$t = "รถกระบะ";
break;
case 3 :
$t = "รถตู้";
break;
}
switch (substr($brand,0,2))
{
case 'CH' :
$b = "CHEVROLET";
break;
case 'FO' :
$b = "FORD";
break;
case 'HO' :
$b = "HONDA";
break;
case 'IS' :
$b = "ISUZU";
break;
case 'MA' :
$b = "MAZDA";
break;
case 'MI' :
$b = "MITSUBISHI";
break;
case 'NI' :
$b = "NISSAN";
break;
case 'SU' :
$b = "SUZUKI";
break;
case 'TO' :
$b = "TOYOTA";
break;
}
$ip=@$REMOTE_ADDR;
?>
<div align="center">
<?
$details = $detail.' ('.$cb1.'/'.$cb2.'/'.$cb3.'/'.$cb4.'/'.$cb5.'/'.$cb6.'/'.$cb7.'/'.$cb8.')';
$today = date("d M Y | H:i น.");
require("config.php");
$max = mysql_query("select max(id) from finance");
$total_max = mysql_result($max,0);
$id = $total_max + 1;
$sql = "INSERT INTO finance (id, finance, cash, type, brand, model, detail, year, gear, power, engine, regis, firstcar, name, tel, mail, address, datetime, ip, mark) values ('$id', '$finance', '$cash', '$t', '$b', '$model', '$details', '$year', '$gear', '$power', '$engine', '$regis', '$firstcar', '$name', '$tel', '$mmail', '$address', '$today', '$ip', '1')";
$result = mysql_query ( $sql, $connection );
if($result)
{
?>
<?
require 'class.phpmailer.php';
$mail = new PHPMailer();
$mail->From = "[email protected]";
$mail->FromName = "Webmaster";
$mail->SMTPSecure = "ssl";
$mail->Host = "ssl://smtp.gmail.com";
$mail->Mailer = "smtp";
$mail->AddAddress("[email protected]"); // name is optional
$mail->WordWrap = 50; // set word wrap to 50 characters
//$mail->IsHTML(true); // set email format to HTML
$mail->CharSet = 'windows-874';
$mail->Subject = "Money Express";
$mail->Body = "Contact us";
$mail->Body .= "Name : $name<br>";
$mail->Body .= "Tel. : $tel<br>";
$mail->Body .= "E-mail : <a href = mailto:$mmail>$mmail</a><br>";
$mail->Body .= "Address: $address<br>";
$mail->AltBody = "\n\nชื่อ : ".$name."\n\nเบอร์ติดต่อ : ".$tel."\n\nอีเมล : ".$mmail."\n\nAddress : ".$address."\n\nข้อความ : ".$result;
$mail->SMTPAuth = "true";
$mail->Username = "[email protected]";
$mail->Password = "xxxxx";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
}
?>
Tag : PHP, CakePHP

|
|
 |
 |
 |
 |
Date :
2014-03-22 08:17:25 |
By :
kabuto555 |
View :
694 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอดู form ที่ส่งมาหน้านี้หน่อยครับ
|
 |
 |
 |
 |
Date :
2014-03-22 13:49:39 |
By :
bruhita |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|