时间:2021-07-01 10:21:17 帮助过:16人阅读
header('Content-Type:text/html;Charset=utf-8');
if ($_POST['loginname'] == 'lee' && $_POST['loginpass'] == '123456') {
      header('location:http://bbs.csdn.net');
} else {
     
} header('Content-type:text/html;Charset=utf-8');  
$user = 'lee';       //登陆用户名   
$pass = '123456';    //登陆密码   
$post_fields = "loginname={$user}&loginpass={$pass}";
$ch = curl_init(); 
curl_setopt($ch,CURLOPT_URL,'http://localhost/2.php');
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$post_fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_exec($ch);
curl_close($ch);