2021-09-27

register.html

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>用户注册</title>
</head>
<body>
	<h2>用户注册</h2>
	<div class="d1">
<form action="check.php" method="post">
	<fieldset>
		<legend>必填字段</legend>
	
	<div>
		<label for="username">用户:</label>
		<input id="username" type="text" name="username" autofocus placeholder="用户名不少于6个字符">
	</div>
	<div>
		<label for="pwd">密码:</label>
		<input id="pwd" type="password" name="pwd" placeholder="密码要高强度保密" required>
	</div>
	<div>
		<label for='email'>邮箱:</label>
		<input id="email" type="email" name="email" placeholder="请输入正确的邮箱格式" >
	</div>
	

</fieldset>

	<div>
		<label for="sct">性别:</label>
		<input id="male" type="radio" name="gender" value="male">
		<label for="male"></label>
		<input id="sct" type="radio" name="gender" vaule="">
		<label for="female"></label>
	</div>
	<div>
		<label for="">爱好:</label>
		<input id="basketbal" type="checkbox" name= "hobby[ ]" value="篮球">
		<label for="basketbal">篮球</label>
		<input id="football" type="checkbox" name= "hobby[]" value="足球">
		<label for="football">足球</label>
		<input id="vollyball" type="checkbox" name= "hobby[]" value="排球">
		<label for="vollyball">排球</label>
	</div>
	<div>
  <label for="">专业:</label>
  <select name= "dept" id="">
	<option value="O">请选择专业</option>
	<option value="1">软件技术</option>
	<option value="2">云计算应用技术</option>
	<option value="3">大数据应用技术</option>
	<option value="4">物联网应用技术</option>

  </select>
</div>
<div>
  <label for="">课程</label>
  <select name= "course[]" id="" multiple= "multiple">
	<option value="01">PHP</option>
	<option value="02">英语</option>
	<option value="03">数据库</option>
	<option value="04">网络技术</option>
  </select>
</div>
<div>
	<label for="">简历:</label>
	<textarea rows="10" cols="30">
		

	</textarea>
</div>
	

	<button>注册</button>
</form>
<div class="upload" id="upload">
	<form action="upload.php" method="post" enctype="multipart/form-data">
		<input type="file" name="file">
		<button>上传</button>
	</form>
</div>
</div>
<style type="text/css">
	.d1{
		width: 400px;
		height: 500px;
		background-color: #5aa;
		padding: 5px;
		margin:0 auto;
	}
</style>





</body>
</html>

check.php

<?php
 $username=$_POST['username'];
// $username=isset($_POST[ " username " ])?$_POST: "";4$username=$_POST[ 'username ' ]??"";
var_dump($username);
$pwd=$_POST[ ' pwd '];
echo "$pwd" ;
echo "<br>";
$email=$_POST[ ' email' ];
echo "邮箱:$email";
echo "<br>";
$gender=$_POST['gender'];
echo "性别:$gender";

 echo "<br>";
 $hobby=$_POST['hobby'];
 echo "爱好:$hobby";

 $dept=$_POST['dept'];
 echo "专业代码:$dept";
 echo "<br>课程:";
 $course=$_POST['course'];
 var_dump($course);

?>

upload.php

<?php

    $file=$_FILES['file'];
    //echo $file['name'];
    //echo $file['type];
    // var_dump ($file);
    $imgfile="";

    if($file['error']==O){
    $imgfile="img/".$file['name'];

    $move check file($file[ ' tmp_name ' ],$imgfile);
 }

?>

<img src=" <?php echo $imgfile ?>" alt="
这是个图片">



效果图: 帅气迷人请添加图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值