flyxg 的web 学习笔记

flyxg   ·   发表于 2018-06-23 14:17:04   ·   CTF&WP专版

3.1

<!DOCTYPE html>
<html>
<head>
  <title>自我介绍</title>
</head>
<body>
<h1>标题,flyxg</h1>
<p>段落,好好学习,天天向上</p>
<br>
</body>
</html>

3.2

<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>QQ空间-分享生活,留住感动</title>
</head>
<body>
<img src="https://qzonestyle.gtimg.cn/qzone_v6/proj_qzonelogin/img/qzone-login-logo.32.png">
<p>账号密码登录</p>
<form>
<input type="text">
<br/>
<input type="password">
<br/>
<input type="submit" >
</form>
<a href="https://aq.qq.com/v2/uv_aq/html/reset_pwd/pc_reset_pwd_input_account.html?v=3.0&old_ver_account=" target="_blank">忘了密码?|</a>
<a href="https://ssl.zc.qq.com/v3/index-chs.html" target="_blank">注册新账号|</a>
<a href="https://support.qq.com/products/14800" target="_blank">意见反馈</a><br/>
<ul>
<li><a href="https://z.qzone.com/download.html" target="_blank">iPhone</a></li>
<li><a href="https://z.qzone.com/download.html" target="_blank">iPad</a></li>
<li><a href="https://z.qzone.com/download.html" target="_blank">Android</a></li>
<li><a href="https://z.qzone.com/download.html" target="_blank">Windows Phone</a></li>
<li><a href="https://z.qzone.com/download.html" target="_blank">其他手机</a></li>
</ul>
<a href="http://support.qq.com/discuss/46_1.shtml" target="_blank">反馈建议|</a>
<a href="https://qzone.qzone.qq.com/" target="_blank">官方空间|</a>
<a href="https://act.qzone.qq.com/" target="_blank">空间活动|</a>
<a href="https://game.qzone.qq.com/?from=gameapp" target="_blank">空间应用|</a>
<a href="https://user.qzone.qq.com/949589999/main" target="_blank">腾讯原创馆|</a>
<a href="https://connect.qq.com/" target="_blank">QQ互联|</a>
<a href="https://connect.qq.com/intro/login/" target="_blank">QQ登录|</a>
<a href="https://connect.qq.com/intro/share/" target="_blank">社交组件|</a>
<a href="http://wiki.open.qq.com/wiki/%E6%8A%95%E8%AF%89%E6%8C%87%E5%BC%95" target="_blank">应用侵权投诉||</a>
<a href="http://wiki.open.qq.com/wiki/Tencent_Open_Platform_Complaint_Guidelines" target="_blank">Complaint Guidelines|</a><br/>
<p>Copyright © 2005 - 2018 Tencent. <a href="https://www.tencent.com/en-us/statement.html" target="_blank">All Rights Reserved.</a></p> 
<p>腾讯公司 <a href="https://www.tencent.com/zh-cn/statement.html?/law/copyright.htm" target="_blank">版本所有</a>
<a href="http://www.qq.com/culture.shtml" target="_blank">粤网文[2017]6138-1456号</a></p> 
</body>
</html>



3.4

#使用的 if语句 和 循环语句 编写程序,求出1-10000中能被3或7整除的数字的和。
<?php 
for ($i=1;$i <10000 ; $i++){ 
	if ($i%3==0 || $i%7==0)  {
		echo $i+"\n";
	}
}
 ?>

3.5

<!-- 功能描述:有2个或多个字段的用户登录表单,点击按钮后提交到后端PHP,判断是否登陆成功。
Tips:尝试使用HTML编写一个Form表单,使用POST或GET方式提交。后端PHP接受提交的内容,然后去数据库查询。
Tips:尝试修复SQL注入漏洞 -->
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>用户等入></title>
</head>
<body>
<h2>PHP 表单验证实例</h2>
<form method="post" action="index.php" method="post">
   username: <input type="text" name="name">
   <br><br>
   password: <input type="password" name="password">
   <br><br>
   <input type="submit" name="submit" value="Submit">
</form>
</body>
?php
$name = $password = "";
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
   $name = test_input($_POST["name"]);
   $password = test_input($_POST["password"]);
   $con = mysqli_connect("127.0.0.1","root","123456","admin");
 if(!$con)  {
	 die("Connection failed: " . mysqli_connect_error());
}
	$sql="select * from admin where user='$name' and password='$password' ";
	$result =mysqli_query($con,$sql);
	$row = mysqli_fetch_array($result);
	if( $row >0 ){
		echo "登入成功";
	}else{
	echo "登入失败";
}
	mysqli_close($con);
}
function test_input($data)
{
  $data = trim($data);
  $data = stripslashes($data);
  $data = htmlspecialchars($data);
  return $data;
}
?>


打赏我,让我更有动力~

0 条回复   |  直到 2018-6-23 | 1068 次浏览
登录后才可发表内容
返回顶部 投诉反馈

© 2016 - 2024 掌控者 All Rights Reserved.