我需要编写一个返回“有效”或“无效参数”的 PHP 脚本
- 表格网址:http ://www.gpsyeah.com/Login.aspx
- 账号:istartekdemo
密码:123456
<?php $url = 'http://www.gpsyeah.com/Login.aspx'; $postfields = array( 'txtUserName' => 'istartekdemo', 'txtAccountPassword' => '123456', 'btnLoginAccount' => '1' ); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_COOKIESESSION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postfields); $return = curl_exec($curl); echo '<pre>'; print_r($return); echo '</pre>'; curl_close($curl); if (!preg_match('#Incorrect#i', $return)) { echo 'VALID'; } else { echo 'INVALID'; } ?>
错误通知使用 Javascript:Alert 显示。那么如何远程检查登录?