21,882
社区成员
发帖
与我相关
我的任务
分享
$str = <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>$thispagetitle{$Website['webtitle']}</title>
<meta name="keywords" content="$web_keywords">
<meta name="description" content="$web_description">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="{$_SkinPath}/css/index.css" rel="stylesheet" type="text/css" />
<link href="{$_SkinPath}/css/public.css" rel="stylesheet" type="text/css" />
<link href="{$_SkinPath}/css/page.css" rel="stylesheet" type="text/css" />
<link href="{$_SkinPath}/css/content.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{$CONFIG['webroot']}/js/$.js"></script>
<script language="javascript" type="text/javascript" src="{$CONFIG['webroot']}/js/inc.js"></script>
<script language="javascript" type="text/javascript" src="{$CONFIG['webroot']}/js/public.js"></script>
</head>
<body>
<h1>hello</h1>
</body>
</html>
EOT;
echo $str;
$ch = curl_init();
$data = array('username' => 'user', 'password' => 'pw');
curl_setopt($ch, CURLOPT_URL, 'http://localhost/a.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec($ch);
curl_close($ch);
print_r($contents);
$content = file_get_contents("http://localhost/a.php");