|
|
|
รบกวน ช่วยแก้โค้ดให้ผมทีคับ เกี่ยวกับ PHP กับฐานข้อมูลคับ |
|
|
|
|
|
|
|
<?php include("header.inc.php");?>
<td><div align="center">
<?php
//$url = $_POST["name"];
$url =array("https://www.thaicreate.com/php/forum/059606.html","http://xxx-underground.net/index.php?cateid=9");
$sum1 = count($url);
//$msg = "XXXมึงxxx";
for ($sum = 0; $sum < $sum1; $sum++)
{
require_once "config_db.php";
$num_rows = mysql_num_rows($dbquery);
$sum2=0;
echo "-----------------------------------------------------";
//echo $url[$sum];
$file = file_get_contents($url[$sum]);
$msg = $file;
echo "<br/>$url[$sum]<br/>";
while(sum2<$num_rows)
{
$data = mysql_fetch_array($dbquery);
$i = 0 ;
$ii = 0;
$a = 0 ;
$c = 0 ;
$num = 0;
$temp = ("$data[censor_b]");
//$msg = ",มึงกากะสาสมึงอะ";
//$a = array ();
$pattern = "$temp";
if(eregi ($pattern,$msg))
{
if($pattern == strtolower($pattern ))
{
$temp1 = strtoupper($pattern);
$i=substr_count($msg,$temp1);
$temp2 = ucfirst($pattern);
$ii=substr_count($msg,$temp2);
if($pattern == strtoupper($pattern ))
{
$temp3 = strtolower($pattern );
$c=substr_count($msg,$temp3);
}
}
$c=substr_count($msg,$temp);
$num = $i+$a+$c+$ii;
echo "พบคำที่ไม่เหมาะสม ";
echo $pattern," ทั้งหมด ",$num," คำ<br/>";
}
$sum2++;
}
mysql_close();
echo "-----------------------------------------------------<br/>";
}
?>
</div></td>
<?php include("under.inc.php"); ?>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-11-24 16:30:53 |
By :
อ่อนหัด |
View :
909 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผิดๆๆๆคับคับ โค้ดนี้คับ
Code (PHP)
<?php include("header.inc.php");?>
<td><div align="center">
<?php require_once "config_db.php";
//$url = $_POST["name"];
$url =array("https://www.thaicreate.com/php/forum/059606.html","http://xxx-underground.net/index.php?cateid=9");
$sum1 = count($url);
//$msg = "XXXมึงxxx";
for ($sum = 0; $sum < $sum1; $sum++)
{
echo "-----------------------------------------------------";
//echo $url[$sum];
$file = file_get_contents($url[$sum]);
$msg = $file;
echo "<br/>$url[$sum]<br/>";
while($data = mysql_fetch_array($dbquery))
{
$i = 0 ;
$ii = 0;
$a = 0 ;
$c = 0 ;
$num = 0;
$temp = ("$data[censor_b]");
//$msg = ",มึงกากะสาสมึงอะ";
//$a = array ();
$pattern = "$temp";
if(eregi ($pattern,$msg))
{
if($pattern == strtolower($pattern ))
{
$temp1 = strtoupper($pattern);
$i=substr_count($msg,$temp1);
$temp2 = ucfirst($pattern);
$ii=substr_count($msg,$temp2);
if($pattern == strtoupper($pattern ))
{
$temp3 = strtolower($pattern );
$c=substr_count($msg,$temp3);
}
}
$c=substr_count($msg,$temp);
$num = $i+$a+$c+$ii;
echo "พบคำที่ไม่เหมาะสม ";
echo $pattern," ทั้งหมด ",$num," คำ<br/>";
}
}
echo "-----------------------------------------------------<br/>";
}
?>
</div></td>
<?php include("under.inc.php"); ?>
|
|
|
|
|
Date :
2011-11-24 16:37:21 |
By :
อ่อนหัด |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
งงกับคำถาม
รบกวนชี้ประเด็นให้ชัดครับ
เดี๋ยวจะมีคนเข้ามาช่วยท่านเอง
^^
|
|
|
|
|
Date :
2011-11-24 17:30:01 |
By :
asustak |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ปํญหาคือวนรอบแรกคำสั่งนี้ทำการ แต่พอวนรอบที่สองไม่ทำงาน
Code (PHP)
while(sum2<$num_rows)
{
$data = mysql_fetch_array($dbquery);
$i = 0 ;
$ii = 0;
$a = 0 ;
$c = 0 ;
$num = 0;
$temp = ("$data[censor_b]");
//$msg = ",มึงกากะสาสมึงอะ";
//$a = array ();
$pattern = "$temp";
if(eregi ($pattern,$msg))
{
if($pattern == strtolower($pattern ))
{
$temp1 = strtoupper($pattern);
$i=substr_count($msg,$temp1);
$temp2 = ucfirst($pattern);
$ii=substr_count($msg,$temp2);
if($pattern == strtoupper($pattern ))
{
$temp3 = strtolower($pattern );
$c=substr_count($msg,$temp3);
}
}
$c=substr_count($msg,$temp);
$num = $i+$a+$c+$ii;
echo "พบคำที่ไม่เหมาะสม ";
echo $pattern," ทั้งหมด ",$num," คำ<br/>";
}
|
|
|
|
|
Date :
2011-11-24 20:26:19 |
By :
อ่อนหัด |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|