PHP cURL - 如何判断我是否已成功登录


PHP cURL - How to tell if I'm successfully logged in?

我正在尝试找出我的登录是否成功。所以我使用我的凭据登录并点击提交当我点击提交时,它所做的只是在帖子字段下方包含其他站点这是我点击提交之前的屏幕截图:http://gyazo.com/cecea7aff4947b953ce093f4328722b4这是我点击提交后的部分屏幕截图:http://gyazo.com/8a03440584c0f9385cb1faef05e11993我尝试输入正确和不正确的凭据,同样的事情正在发生。我不确定我的登录是否成功。登录后,我打算在会员区发帖。

注意:现在没有使用消息发布字段,我将将其用于其他事情,但这是我的代码:

<html>
<div>
        <form method="POST">
            Message: <input name="message" type="text" size="25" /></br>
            Username:<input name="username" type="text" size="25" /></br>
            password:<input name="password" type="password" size="25" /></br>
            <input name="submit" type="submit" value="submit" />
        </form>
    </div>
    </html>
<?php
if(isset($_POST['message'])){$message= $_POST['message'];}
if(isset($_POST['username'])){$username = $_POST['username'];}
if(isset($_POST['password'])){$password = $_POST['password'];}
if(isset($_POST['submit'])){
$link = "http://site.com/index.php?section=login;
$datatopost = array (
"auth_key" => "880ea6a14ea49e853634fbdc5015a024",
"referer" => "http://google.com",
"ips_username" => $_POST['username'],
"ips_password" => $_POST['password'],
);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $link);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$returndata = curl_exec($ch);
echo $returndata;
curl_close($ch);
};

?>

我想登录是在服务器端。 您应该从您发布到的文件中返回一些内容,成功或失败。

登录后你会回显一些东西吗?