|
|
|
เรื่อง รีหน้าเว็บใหม่ครับ รีเฟรสใหม่ ช่วยดูอันนี้ให้ผมทีครับ PHP |
|
|
|
|
|
|
|
คือผมอยากไม่ให้มันรีเฟรสหน้าเอง หรือรีหน้าเว็บเองอ่าครับ อันนี้ผ่านไปไม่กี่วินาทีมันก็รีหน้าเว็บเองตลอดเลยครับ แก้ให้ผมที
Code (PHP)
<?php
include("config.php");
//RAND
function random($length)
{
//rand(0,time());
$possible='1234567890';
$str = '';
while(strlen($str)<$length)
{
$str.=substr($possible,(rand()%(strlen($possible))),1);
}
$txt = $str;
return $txt;
}
$_CONFIG['msg'][0] = random(90);
$_CONFIG['msg'] = $_CONFIG['msg'][rand(0,count($_CONFIG['msg'])-1)];
$_CONFIG['delay'] = '0';
function template($name) {
return file_get_contents($name . '.html');
}
function createPage($data) {
return str_replace('{#DATA}',$data,template('template'));
}
function getChecksum($katoo) {
$data = file_get_contents('http://bbs.pramool.com/webboard/followup.php3?katoo=' . $katoo);
return substr($data,strpos($data,'checksum/index7.php?imgnum=')+27,80);
}
function postData($file,$ktsub,$name,$password=NULL,$checksum,$checkkey,$pic=2,$body) {
//$att_data = file_get_contents('digz.gif');
$dat = '';
$dat .= "-----------------------------262762878619883\r\n";
$dat .= "Content-Disposition: form-data; name=\"file\"\r\n";
$dat .= "\r\n";
$dat .= $file."\r\n";
$dat .= "-----------------------------262762878619883\r\n";
$dat .= "Content-Disposition: form-data; name=\"ktsub\"\r\n";
$dat .= "\r\n";
$dat .= $ktsub."\r\n";
$dat .= "-----------------------------262762878619883\r\n";
$dat .= "Content-Disposition: form-data; name=\"name\"\r\n";
$dat .= "\r\n";
$dat .= $name."\r\n";
$dat .= "-----------------------------262762878619883\r\n";
$dat .= "Content-Disposition: form-data; name=\"password\"\r\n";
$dat .= "\r\n";
$dat .= $password."\r\n";
$dat .= "-----------------------------262762878619883\r\n";
$dat .= "Content-Disposition: form-data; name=\"checksum\"\r\n";
$dat .= "\r\n";
$dat .= $checksum."\r\n";
$dat .= "-----------------------------262762878619883\r\n";
$dat .= "Content-Disposition: form-data; name=\"checkkey\"\r\n";
$dat .= "\r\n";
$dat .= $checkkey."\r\n";
$dat .= "-----------------------------262762878619883\r\n";
$dat .= "Content-Disposition: form-data; name=\"pic\"\r\n";
$dat .= "\r\n";
$dat .= $pic."\r\n";
$dat .= "-----------------------------262762878619883\r\n";
$dat .= "Content-Disposition: form-data; name=\"body\"\r\n";
$dat .= "\r\n";
$dat .= $body."\r\n";
//$dat .= "-----------------------------262762878619883\r\n";
//$dat .= "Content-Disposition: form-data; name=\"file-to-upload-01\"; filename=\"digz.gif\"\r\n";
//$dat .= "Content-Type: image/jpeg\r\n\r\n";
//$dat .= $att_data."\r\n";
$dat .= "-----------------------------262762878619883--\r\n";
$servers = array();
$servers[0] = array('bbs.pramool.com','/cgi-bin/webboard/followup3.cgi');
$server = substr(0,count($servers)-1);
$connection = fsockopen($servers[$server][0], 80, $errorNumber, $errorString, 15);
$requestHeader = 'POST ' . $servers[$server][1] . " HTTP/0.1\r\nHost: " . $servers[$server][0] . "\r\nUser-Agent: Mozilla/0.1 (Windows; U; Windows NT 0.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/0.1\r\nReferrer: http://bbs.pramool.com/webboard/followup.php3\r\nContent-Type: multipart/form-data; boundary=---------------------------262762878619883\r\nContent-Length: ".strlen($dat)."\r\n\r\n";
$requestHeader .= $dat;
fputs($connection, $requestHeader);
while (!feof($connection)) {
$data.=fgets($connection,500);
}
fclose($connection);
define('RESP_BEGIN','<center>');
define('RESP_END','</center>');
$tmp = strstr($data,RESP_BEGIN);
$resp = substr(strstr($tmp,RESP_BEGIN),strlen(RESP_BEGIN),strpos(strstr($tmp,RESP_BEGIN),RESP_END) - strlen(RESP_BEGIN));
return $resp;
}
if($_POST['cmd'] == 'dig') {
$data = postData($_CONFIG['katoo'],'-',$_CONFIG['user'],$_CONFIG['pass'],$_POST['checksum'],$_POST['checkkey'],rand(1,300),$_CONFIG['msg']);
$data = header("Location: index.php");
}
else {
$data = template('pre_dig');
$checksum = getChecksum($_CONFIG['katoo']);
$data = str_replace('{#CHECKSUM}',$checksum,$data);
}
echo createPage($data);
?>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-10-11 00:50:19 |
By :
coolgay01 |
View :
1042 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่มีคำสั่งไหนที่ Refresh หรือ Redirect ครับ นอกจาก $data = header("Location: index.php");
|
|
|
|
|
Date :
2011-10-11 06:02:32 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|