 |
|
|
 |
 |
|
วิธีพวกนี้อาศัยการตั้ง cron ทำงานครับ โดย Query เงื่อนไที่ต้องการ เมื่อได้ Record แล้วอยากจะส่งอะไรก็ส่งได้ครับ
|
 |
 |
 |
 |
Date :
2011-08-09 16:37:38 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่เข้าใจเลยครับพี่วิน ช่วยอธิบายเยอะๆได้มั้ยครับ มองไม่ออกเลยครับไม่เคยเขียนด้วยครับขอบคุณล่วงหน้าครับ
|
 |
 |
 |
 |
Date :
2011-08-09 22:21:00 |
By :
gmgo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใน Control Panel พวก Cpanel/Direct Admin จะมีการตั้ง Cron ให้เรียกไฟล์ได้ตามเวลาที่กำหนดครับ 
|
 |
 |
 |
 |
Date :
2011-08-10 08:52:46 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับทุกคำตอบ
|
 |
 |
 |
 |
Date :
2011-08-10 18:50:55 |
By :
gmgo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<? include"checksession.php"; ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?
include"config.php";
$sql="update user set get_point=$show_num, point=point+$show_num where username='$user'";
$result=mysql_db_query($db_name,$sql) or die (mysql_error());
if ($result==1){
echo"<script>
window.location='show_point.php';</script>";
//alert('บันทึกแต้ม.$show_num.เรียบร้อยแล้วค่ะ');
}else{
echo "โค้ดนี้ถูกบันทึกแต้มไปแล้วค่ะ";
}
$sql="select * from user inner join point where username='$user' ";
$result=mysql_db_query($db_name,$sql) or die (mysql_error());
$num=mysql_num_rows($result) or die (mysql_error());
$record=mysql_fetch_array($result) or die (mysql_error());
$to=$record[email];
$userpoint=$record[point];
switch($userpoint){
case '$userpoint>=100 and $userpoint<=499':
$subject="ยินดีด้วยน่ะค่ะคุณมีคะแนนมากพอที่จะแลกของรางวัลกับเรา";
$message="คะแนนของ$user คือ $userpoint";
$headers="From: www.pointsystem.com";
mail($to,$subject,$message,$headers);
break;
case '$userpoint>=500 and $userpoint<=999':
$subject="ยินดีด้วยน่ะค่ะคุณมีคะแนนมากพอที่จะแลกของรางวัลกับเรา";
$message="คะแนนของ$user คือ $userpoint";
$headers="From: www.pointsystem.com";
mail($to,$subject,$message,$headers);
break;
}
mysql_close();
?>
มันทำไมไม่เข้าเมล์ครับ ช่วยเช็คให้ทีน่ะครับ
|
 |
 |
 |
 |
Date :
2011-08-10 23:48:54 |
By :
gmgo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้ if แทน switch เถอะครับ
|
 |
 |
 |
 |
Date :
2011-08-10 23:54:36 |
By :
ikikkok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<? include"checksession.php"; ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?
include"config.php";
$sql="update user set get_point=$show_num, point=point+$show_num where username='$user'";
$result=mysql_db_query($db_name,$sql) or die (mysql_error());
if ($result==1){
echo"<script>
window.location='show_point.php';</script>";
//alert('บันทึกแต้ม.$show_num.เรียบร้อยแล้วค่ะ');
}else{
echo "โค้ดนี้ถูกบันทึกแต้มไปแล้วค่ะ";
}
$sql="select * from user inner join point where username='$user' ";
$result=mysql_db_query($db_name,$sql) or die (mysql_error());
$num=mysql_num_rows($result) or die (mysql_error());
$record=mysql_fetch_array($result) or die (mysql_error());
$to=$record[email];
$userpoint=$record[point];
if ($userpoint >=100 and $userpoint<=499) {
echo "คุณมีคะแนน=".$point;
$subject="ยินดีด้วยน่ะค่ะคุณมีคะแนนมากพอที่จะแลกของรางวัลกับเรา";
$message="คะแนนของ$user คือ $userpoint";
$headers="From: www.pointsystem.com";
if(mail($to,$subject,$message,$headers)){
} else if ($userpoint>=500) {
$subject="ยินดีด้วยน่ะค่ะคุณมีคะแนนมากพอที่จะแลกของรางวัลกับเรา";
$message="คะแนนของ$user คือ $userpoint";
$headers="From: www.pointsystem.com";
if(mail($to,$subject,$message,$headers)){
}
}
}
mysql_close();
?>
ได้มั้ยครับพี่ปากิม
|
ประวัติการแก้ไข 2011-08-10 23:59:20
 |
 |
 |
 |
Date :
2011-08-10 23:58:43 |
By :
gmgo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<? include"checksession.php"; ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?
include"config.php";
$sql="update user set get_point=$show_num, point=point+$show_num where username='$user'";
$result=mysql_db_query($db_name,$sql) or die (mysql_error());
if ($result==1){
echo"<script>
window.location='show_point.php';</script>";
//alert('บันทึกแต้ม.$show_num.เรียบร้อยแล้วค่ะ');
}else{
echo "โค้ดนี้ถูกบันทึกแต้มไปแล้วค่ะ";
}
$sql="select * from user inner join point where username='$user' ";
$result=mysql_db_query($db_name,$sql) or die (mysql_error());
$num=mysql_num_rows($result) or die (mysql_error());
$record=mysql_fetch_array($result) or die (mysql_error());
$to=$record[email];
$userpoint=$record[point];
if($userpoint>=100 and $userpoint<=499){
$subject="ยินดีด้วยน่ะค่ะคุณมีคะแนนมากพอที่จะแลกของรางวัลกับเรา";
$message="คะแนนของ$user คือ $userpoint";
$headers="From: www.pointsystem.com";
mail($to,$subject,$message,$headers);
}else if($userpoint>=500 and $userpoint<=999){
$subject="ยินดีด้วยน่ะค่ะคุณมีคะแนนมากพอที่จะแลกของรางวัลกับเรา";
$message="คะแนนของ$user คือ $userpoint";
$headers="From: www.pointsystem.com";
mail($to,$subject,$message,$headers);
}
}
mysql_close();
?>
|
 |
 |
 |
 |
Date :
2011-08-11 00:04:42 |
By :
ikikkok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับพี่ ขอบคุณมากครับพี่ปากิม
|
 |
 |
 |
 |
Date :
2011-08-11 00:18:50 |
By :
gmgo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ่า...ว่าจะมาตอบ คุณปลากริมมาพาถึงฝั่งแล้ว 
|
 |
 |
 |
 |
Date :
2011-08-11 00:32:10 |
By :
tomrambo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณทุกคนน่ะครับที่ช่วย
|
 |
 |
 |
 |
Date :
2011-08-11 00:45:15 |
By :
gmgo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|