config.php file
Your user name and password, as well as the database name, and the table name, are defined here once!!!
Because of the fear that the user name and password are seen by others through the browser, so the PHP extension, so that browsing will not see the!!!.
$username = ' your_name '; User name
$password = ' Your_password '; Password
$hostname = ' localhost '; Host name, usually localhost
$db _name= ' Your_db_name '; Database name
$table _name= ' your_liuyan_table '; Name of the table holding the message
$table _name_c/^ (. *)/';
$replacement = "\1$str_suffix";
$msg =preg_replace ($pattern, $replacement, $msg);
return ($MSG);
}
function Check_en_num ($msg)
{
$pattern = '/[x00-x7f]/';
Preg_match_all ($pattern, $msg, $matches);
$num 2=count ($matches [0]);
Return ($num 2%2);
}
function Short_one ($msg)
{
$pattern = '/.$/';
$replacement = ";
$result =preg_replace ($pattern, $replacement, $msg);
return ($result);
}
function Pian_question ($msg)
{
$pattern = "/'/";
$replacement = "'";
$temp =preg_replace ($pattern, $replacement, $msg);
$pattern = "/\"/";
$replacement = "'";
$result =preg_replace ($pattern, $replacement, $temp);
return ($result);
}
function Check_last ($msg)
{
$pattern = '/.$/';
Preg_match ($pattern, $msg, $match);
if ($match [0]> ' ~ ')
return (1);
Else
return (0); echo "English";
}
$num 5=short_one ($test);
echo $num 5;
function Computer_message ($msg, $hang _zifu_number)
{
$msg =pian_question ($msg);
$arr _ph/n/", $msg);
$num =count ($arr _phone);
Echo $num;
echo "
";
$num 2=strlen ($arr _phone[0]);
echo $num 2;
$first _line=1;
for ($i =0; $i < $num; $i + +)
{
while ($str _num=strlen ($arr _phone[$i]) > $hang _zifu_number)
{
$first _line=0;
$workstr = $arr _phone[$i];
$pattern _pre50= "/. {". $hang _zifu_number."} /";
Preg_match_all ($pattern _pre50, $workstr, $matches);
$temp = $matches [0][0];
if ((Check_last ($temp) ==1) and (Check_en_num ($temp) ==1)//Ji Shu and Chinese
{
$hang _zifu_short
$pattern _replace= "/^. {". $hang _zifu_shortone."} /";
$replacement = ";
$arr _phone[$i]=preg_replace ($pattern _replace, $replacement, $WORKSTR);
The first 49 finishes!
$temp =short_one ($temp); Subtract one from 50.
}
Else
{
$pattern _replace= "/^. {". $hang _zifu_number."} /";
$replacement = ";
$arr _phone[$i]=preg_replace ($pattern _replace, $replacement, $WORKSTR);
}
$message = $message. $temp. "
";
}
if ($first _line==1) and (strlen ($arr _phone[$i]) < $hang _zifu_number))
{
$first _line=0;
$temp _addblank= $arr _phone[$i];
$temp _addblank=add_blankto50 ($temp _addblank, $hang _zifu_number);
$message = $temp _addblank. "
";
}
Else
$message = $message. $arr _phone[$i]. "
";
}
return ($message);
}
$num 1=strlen ($test);
echo $num 1;
Echo $test;
echo "
";
$mes =add_blankto50 ($test);
$num 9=strlen ($mes);
echo $num 9;
$result =ip_question ($test);
Computer_message ($test);
echo $result;
function Checkpass ($passwd, $action, $db _name, $table _name_control, $id _link)
{
if ($action = "Delete")
$str _sql= "Select value from $table _name_control where leibie= ' delete ';";
else if ($action = "Huifu")
$str _sql= "Select value from $table _name_control where leibie= ' Huifu ';";
Else
echo "Error";
$result =mysql_db_query ($db _name, $str _sql, $id _link);
if (! $result) {
Affy_error_exit (' SQL execution has failed. ');}
$record = Mysql_fetch_object ($result);
Echo $record->value;
echo "
";
Echo $passwd;
echo "
";
if ($record->value== $passwd)
return (1);
Else
return (0);
}
$msg =computer_message ($test, $hang _zifu_number);
Echo $msg;
?>
"The copyright of this article is owned by the author and house Orso near net, if need to reprint, please specify the author and source"
The above describes the free message this challenge the best message of the source (iv), including the content of the free message, I hope that the PHP tutorial interested in a friend helpful.