Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 这个php签到源码,我如果想把两个帐号固定内置在代码里,要怎么写呢? @sibang大侠 谢谢!

这个php签到源码,我如果想把两个帐号固定内置在代码里,要怎么写呢? @sibang大侠 谢谢!

Jun 23, 2016 pm 02:39 PM

本帖最后由 tangdeli98 于 2013-12-17 15:08:00 编辑

下面这个php签到源码,我如果想把两个帐号固定内置在代码里,要怎么写呢? (感谢sibang大侠,昨天帮我修改的代码.) 

我不会php,只做桌面软件.我自己试图下面这样改,按我做桌面软件的逻辑应该是可以的,就是变量不断重新赋值然后执行命令.但是改后的php代码报部署不成功,应该是有错.要怎么写呢?我想一次性签多个帐号,到时候挂cron任务上去,访问一次这个php文件的URL链接(比如http://checkuxin.duapp.com/index.php?Id=&pw=&vi)就全部签好.    一个个弄太麻烦.
求php前辈们帮看下,越具体越好. 多谢!!
-----这个是我自己修改的想内置两个帐号进去的修改的部分(完整代码的第97行开始改,就是多加一次赋值而已,其余全部不动):----
if($id!='' and $do=='vi'){        $id='1355114'//-----------------------------帐号1		$pw='653'		$rang=rand(333,8888);        $url="http://im.uxin.com:8887/login?sn=".$rang."&account=".$id."&pwd=".md5($pw)."&pv=android&v=2.8.4&sign=".md5($rang.$id."k1oET&Yh7@EQnp2XdTP1o/Vo=")."&netmode=1&brand=Xiaomi&model=MI+2SC&osv=4.1.1&imei=".rand(10000,99999).rand(10000,99999).rand(10000,99999);        $cont=httpreq($url,1);        if(strstr($cont,'uid')){                echo "登录成功<br/>";        }else{                echo "登录失败<br/>";        }        $url="http://im.uxin.com:8887/signin?sn=".$rang."&sign=".md5($rang."k1oET&Yh7@EQnp2XdTP1o/Vo=");        $content=json_decode(httpreq($url),true);		        //echo $content['content'];		echo '<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">',var_dump($content),'
Copy after login
Copy after login
'; die(); $id='151175'//-----------------------------帐号2 $pw='053' $rang=rand(333,8888); $url="http://im.uxin.com:8887/login?sn=".$rang."&account=".$id."&pwd=".md5($pw)."&pv=android&v=2.8.4&sign=".md5($rang.$id."k1oET&Yh7@EQnp2XdTP1o/Vo=")."&netmode=1&brand=Xiaomi&model=MI+2SC&osv=4.1.1&imei=".rand(10000,99999).rand(10000,99999).rand(10000,99999); $cont=httpreq($url,1); if(strstr($cont,'uid')){ echo "登录成功
"; }else{ echo "登录失败
"; } $url="http://im.uxin.com:8887/signin?sn=".$rang."&sign=".md5($rang."k1oET&Yh7@EQnp2XdTP1o/Vo="); $content=json_decode(httpreq($url),true); //echo $content['content']; echo '
',var_dump($content),'
Copy after login
'; die();
-------下面是不固定内置帐号时的可用代码:--------------------------------
<?PHPset_time_limit(0);ini_set('display_errors','on');error_reporting(E_ALL);header('Content-type: text/html; charset=UTF-8');$id=(isset($_REQUEST["id"])) ? trim($_REQUEST["id"]) : '';$pw=(isset($_REQUEST["pw"])) ? trim($_REQUEST["pw"]) : '';$do=(isset($_REQUEST["do"])) ? trim($_REQUEST["do"]) : '';if($id!='' and $pw!=''){        setcookie("id",$id);        setcookie("pw",$pw);}header("Content-type: text/html; charset=UTF-8");$cookie_file = dirname(__FILE__)."/cookie_".md5(basename(__FILE__)).".txt";date_default_timezone_set('PRC');function httpreq($url,$getcookie=0){        $ch = curl_init();        curl_setopt($ch, CURLOPT_URL, $url);        curl_setopt($ch, CURLOPT_USERAGENT, "Dalvik/1.6.0 (Linux; U; Android 4.1.1; MI 2SC MIUI/JLB14.0)");        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);        $getcookie?curl_setopt($ch, CURLOPT_COOKIEJAR, $GLOBALS['cookie_file']):curl_setopt($ch, CURLOPT_COOKIEFILE, $GLOBALS['cookie_file']);        $result = curl_exec($ch);        curl_close($ch);        return $result;}?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />        <link rel="shortcut icon" href="http://sovi.cc/favicon.ico" /><title>签到</title>        <style type="text/css">                body{text-align:center;                        margin:0 auto;                        font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;                        background-color:#EAEAEA;                }                .main{text-align:left;                        word-wrap:break-word;                        overflow:hidden;padding:5px;                        background:#FFFFFF;                        border:1px solid #C6C6C6;                }                .nav{padding:1px;                        background:#FFFBE1;                        border:1px solid #FEBF90;                }                .ButtonCss{                        font-family: "Tahoma", "宋体";                        font-size:9pt; color: #003399;                        border: 1px #003399 solid;                        color:006699;                        BORDER-BOTTOM: #93bee2 1px solid;                        BORDER-LEFT: #93bee2 1px solid;                        BORDER-RIGHT: #93bee2 1px solid;                        BORDER-TOP: #93bee2 1px solid;                        background-color: #e8f4ff;                        CURSOR: hand;                        font-style: normal ;                        width:60px;                        height:22px;                }                a{                        text-decoration:none;color:#0A63BB;                }                a:hover{text-decoration:underline;color:#DE0000;                }                img,a img{border:none                }                .form                {                position:static;                z-index:1000;                background:gray;                background-color:#FFCC00;                filter : progid:DXImageTransform.Microsoft.DropShadow(color=#FF404040,offX=2,offY=2,positives=true);                }                .tip{color:#DE0000;                }        </style></head><body>        <form method="post" action="?do=vi">                帐号<br/>                <input type="text" name="id" size="20" value="<?php echo $id; ?>"/><br/>                密码<br/>                <input type="password" name="pw" size="20" value="<?php echo $pw; ?>"/><br/>                <input type="submit" class="ButtonCss" />        </form><?phpif($id!='' and $do=='vi'){        $rang=rand(333,8888);        $url="http://im.uxin.com:8887/login?sn=".$rang."&account=".$id."&pwd=".md5($pw)."&pv=android&v=2.8.4&sign=".md5($rang.$id."k1oET&Yh7@EQnp2XdTP1o/Vo=")."&netmode=1&brand=Xiaomi&model=MI+2SC&osv=4.1.1&imei=".rand(10000,99999).rand(10000,99999).rand(10000,99999);        $cont=httpreq($url,1);        if(strstr($cont,'uid')){                echo "登录成功<br/>";        }else{                echo "登录失败<br/>";        }        $url="http://im.uxin.com:8887/signin?sn=".$rang."&sign=".md5($rang."k1oET&Yh7@EQnp2XdTP1o/Vo=");        $content=json_decode(httpreq($url),true);		        //echo $content['content'];		echo '<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">',var_dump($content),'
Copy after login
'; die();}?>
时间:
网站首页
Copyrightvi1.c.All Rights Reserved


回复讨论(解决方案)

$users=array(		array('username1','password1'),		array('username2','password2'),		array('username3','password3'),		//....	);	//遍?array?的每一???然後循??行	foreach($users as $k=>$v) {		$rang=rand(333,8888);		$url="http://im.uxin.com:8887/login?sn=".$rang."&account=".$v[0]."&pwd=".md5($v[1])."&pv=android&v=2.8.4&sign=".md5($rang.$v[0]."k1oET&Yh7@EQnp2XdTP1o/Vo=")."&netmode=1&brand=Xiaomi&model=MI+2SC&osv=4.1.1&imei=".rand(10000,99999).rand(10000,99999).rand(10000,99999);		$cont=httpreq($url,1);		if(strstr($cont,'uid')){			echo "登录成功<br/>";		}else{			echo "登录失败<br/>";		}		$url="http://im.uxin.com:8887/signin?sn=".$rang."&sign=".md5($rang."k1oET&Yh7@EQnp2XdTP1o/Vo=");		$content=json_decode(httpreq($url),true);		 		//echo $content['content'];		echo '<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">',var_dump($content),'
Copy after login
'; }unset($users); die();

$users=array(	die();
Copy after login
十分感谢!!我去测试下. 多谢!!


刚测试不知道是不是我空间暂时有问题,还是报部署错误.我空间又不指明是什么错.我等下再测试下.
问下代码上是简单替换掉原先代码的97-111行是吗?
下面这个是我简单替换97-111行后完整的代码:求帮看下,从代码上来说,完整的代码是这样就可以吗?多谢!!(假如我三个帐号分别是array('138999','pd1'),
array('137999','pd2'),
array('136987','pd3'))

<?PHPset_time_limit(0);ini_set('display_errors','on');error_reporting(E_ALL);header('Content-type: text/html; charset=UTF-8');$id=(isset($_REQUEST["id"])) ? trim($_REQUEST["id"]) : '';$pw=(isset($_REQUEST["pw"])) ? trim($_REQUEST["pw"]) : '';$do=(isset($_REQUEST["do"])) ? trim($_REQUEST["do"]) : '';if($id!='' and $pw!=''){        setcookie("id",$id);        setcookie("pw",$pw);}header("Content-type: text/html; charset=UTF-8");$cookie_file = dirname(__FILE__)."/cookie_".md5(basename(__FILE__)).".txt";date_default_timezone_set('PRC');function httpreq($url,$getcookie=0){        $ch = curl_init();        curl_setopt($ch, CURLOPT_URL, $url);        curl_setopt($ch, CURLOPT_USERAGENT, "Dalvik/1.6.0 (Linux; U; Android 4.1.1; MI 2SC MIUI/JLB14.0)");        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);        $getcookie?curl_setopt($ch, CURLOPT_COOKIEJAR, $GLOBALS['cookie_file']):curl_setopt($ch, CURLOPT_COOKIEFILE, $GLOBALS['cookie_file']);        $result = curl_exec($ch);        curl_close($ch);        return $result;}?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />        <title>到</title>        <style type="text/css">                body{text-align:center;                        margin:0 auto;                        font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;                        background-color:#EAEAEA;                }                .main{text-align:left;                        word-wrap:break-word;                        overflow:hidden;padding:5px;                        background:#FFFFFF;                        border:1px solid #C6C6C6;                }                .nav{padding:1px;                        background:#FFFBE1;                        border:1px solid #FEBF90;                }                .ButtonCss{                        font-family: "Tahoma", "宋体";                        font-size:9pt; color: #003399;                        border: 1px #003399 solid;                        color:006699;                        BORDER-BOTTOM: #93bee2 1px solid;                        BORDER-LEFT: #93bee2 1px solid;                        BORDER-RIGHT: #93bee2 1px solid;                        BORDER-TOP: #93bee2 1px solid;                        background-color: #e8f4ff;                        CURSOR: hand;                        font-style: normal ;                        width:60px;                        height:22px;                }                a{                        text-decoration:none;color:#0A63BB;                }                a:hover{text-decoration:underline;color:#DE0000;                }                img,a img{border:none                }                .form                {                position:static;                z-index:1000;                background:gray;                background-color:#FFCC00;                filter : progid:DXImageTransform.Microsoft.DropShadow(color=#FF404040,offX=2,offY=2,positives=true);                }                .tip{color:#DE0000;                }        </style></head><body>        <form method="post" action="?do=vi">                帐号<br/>                <input type="text" name="id" size="20" value="<?php echo $id; ?>"/><br/>                密码<br/>                <input type="password" name="pw" size="20" value="<?php echo $pw; ?>"/><br/>                <input type="submit" class="ButtonCss" />        </form><?phpif($id!='' and $do=='vi'){$users=array(		array('138999','pd1'),		array('137999','pd2'),		array('136987','pd3'),		//....	);	//遍?array?的每一???然後循??行	foreach($users as $k=>$v) {		$rang=rand(333,8888);		$url="http://im.uxin.com:8887/login?sn=".$rang."&account=".$v[0]."&pwd=".md5($v[1])."&pv=android&v=2.8.4&sign=".md5($rang.$v[0]."k1oET&Yh7@EQnp2XdTP1o/Vo=")."&netmode=1&brand=Xiaomi&model=MI+2SC&osv=4.1.1&imei=".rand(10000,99999).rand(10000,99999).rand(10000,99999);		$cont=httpreq($url,1);		if(strstr($cont,'uid')){			echo "登录成功<br/>";		}else{			echo "登录失败<br/>";		}		$url="http://im.uxin.com:8887/signin?sn=".$rang."&sign=".md5($rang."k1oET&Yh7@EQnp2XdTP1o/Vo=");		$content=json_decode(httpreq($url),true);		 		//echo $content['content'];		echo '<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">',var_dump($content),'
Copy after login
'; }unset($users); die();}?>


部署成功了,但是运行测试报错第22行:
"Fatal error: Call to undefined function curl_init() in /home/vcap/app/www/index.php on line 22"
就是这行:

        $ch = curl_init();
Copy after login
Copy after login

按理说有错也不应该是这行错?


部署成功了,但是运行测试报错第22行:
"Fatal error: Call to undefined function curl_init() in /home/vcap/app/www/index.php on line 22"
就是这行:

        $ch = curl_init();
Copy after login
Copy after login

按理说有错也不应该是这行错? ??你的php的curl模?

??你的php的curl模? 问题是替换这个代码之前一样的curl函数,都能正常运行,这说明我空间curl模块是开启的. 
替换成这个内置帐号代码后就一直报这个错...昨天今天测试一直都报这个错.

查看phpinfo.php
看curl扩展是否启用

PHP代??有??,有???,??是你的PHP?境有??

PHP代??有??,有???,??是你的PHP?境有??
应该是我空间的问题.但是蛮奇怪的,没替换之前的代码完全可以运行.
多谢!! 改天我去换个空间看下.谢谢!

ok,或者你在本?安?一下xampp??集成的PHP?境也可以??

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

Customizing/Extending Frameworks: How to add custom functionality. Customizing/Extending Frameworks: How to add custom functionality. Mar 28, 2025 pm 05:12 PM

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

Framework Security Features: Protecting against vulnerabilities. Framework Security Features: Protecting against vulnerabilities. Mar 28, 2025 pm 05:11 PM

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

See all articles