Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 菜鸟求教个菜问题,这个php签到源码,我想通过提交个URL来传参数并执行自动签到,要怎么?多谢!!

菜鸟求教个菜问题,这个php签到源码,我想通过提交个URL来传参数并执行自动签到,要怎么?多谢!!

Jun 23, 2016 pm 02:39 PM

本帖最后由 tangdeli98 于 2013-12-16 14:08:46 编辑

完全小白,只做桌面软件,php完全没用过.这个也是人家的代码,我如果想弄成通过提交URL来传参数并执行签到动作,要怎么弄?我想通过这个URL来挂到cron网络任务里去,就可以全自动签到了.

这个是我这个代码已经传到空间的测试地址: http://checkuxin.duapp.com/index.php
我构造了下面这样格式的URL地址,提交后会自动填表单但不会自动执行签到(相当于还要自己手工按一下那个"签到"按钮,这样的话没法cron网络任务签了)
" http://checkuxin.duapp.com/index.php?id=我的帐号&pw=我的密码&vi=签到"

我看了下代码里好像用post,是不是就不能弄成简单一个URL来实现了? 是不是要弄成get才能呢?我试图直接把源码里的post改成get,结果代码会报错.

要怎么弄,才能通过这样一个URL(http://checkuxin.duapp.com/index.php?id=我的帐号&pw=我的密码&vi=签到)就执行签到呢?

或者有没有什么办法我把帐号(我有两个帐号,需要都内置进去)全部内置到源码里去,然后直接访问http://checkuxin.duapp.com/index.php 就全部自动签到呢?

不会php,求前辈们帮我看下,越具体越好,超感谢!! index.php的代码如下:
<?php$id=$_POST["id"];$pw=$_POST["pw"];if($id!=''&&$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="<?php echo $_SERVER['SCRIPT_NAME']?>">                帐号<br/>                <input type="text" name="id" size="20" value="<?php echo $_REQUEST['id']?>"/><br/>                密码<br/>                <input type="password" name="pw" size="20" value="<?php echo $_REQUEST['pw']?>"/><br/>                <input type="submit" name="vi" class="ButtonCss" value="签到"/>        </form><?phpif($id!=''&&$pw!=''&&$_POST['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'];}?><br/>        时间:<?php echo date("Y-m-d H:i:s")?><br/>        <a href="http://s.c/">网站首页</a><br/>        Copyright<font color="red">vi1.c</font>.All Rights Reserved<br/></body></html>
Copy after login


回复讨论(解决方案)

$id=$_POST["id"];
$pw=$_POST["pw"];
?是用post方法??取??

$id=$_REQUEST['id'];
???就可以同??post和get方式?取??了.

$id=$_POST["id"];
$pw=$_POST["pw"];
?是用post方法??取??

$id=$_REQUEST['id'];
???就可以同??post和get方式?取??了. 那我只要头部这两个POST改一下就可以呵?其它地方还需要改吗?多谢!!

???就可以同??post和get方式?取??了. 刚测试了一下,还是不行,还是只会填表单,不会执行签到.谢谢!

你可能要研究一下php的curl,用curl模?提交即可.

你可能要研究一下php的curl,用curl模?提交即可. 不会php, 求帮忙呢.是不是这个源码里加一句什么就可以呢?第98行应该就是签到(前面是先登录),是不是这句后面加个什么呢? 多谢!!

我??修改了一下,你??下

<?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 '<pre class="brush:php;toolbar:false">',var_dump($content),'
Copy after login
'; die();}?>
时间:
网站首页
Copyrightvi1.c.All Rights Reserved

多谢!!测试还是不行,提交url后只填了表单:

我??修改了一下,你??下 啊啊,抱歉,是我弄错了,最后那个参数我没弄对.现在可以了,太感谢了!!超感谢!!

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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 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)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

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-

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

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' =>

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.

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

Announcement of 2025 PHP Situation Survey Announcement of 2025 PHP Situation Survey Mar 03, 2025 pm 04:20 PM

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio

Notifications in Laravel Notifications in Laravel Mar 04, 2025 am 09:22 AM

In this article, we're going to explore the notification system in the Laravel web framework. The notification system in Laravel allows you to send notifications to users over different channels. Today, we'll discuss how you can send notifications ov

See all articles