使用HTML和CSS和PHP实现一个简单的简历制作项目

news2024/10/6 8:40:51

掌握HTML表单作用,以及action和method属性;

掌握HTML输入域作用、类型、标签,以及name和value属性;

掌握$_REQUEST变量的作用、语法和使用;

掌握注释,以及变量的作用、命名、赋值和输出;

掌握PHP+HTML混合编程。

  1. 使用HTML表单设计和实现下图简历;
  2. 使用PHP实现简历数据验证功能,包括输出简历信息,验证姓名(非空)、手机长度,验证年龄(18-60岁)范围等;
  3. 尝试用中文显示性别、学历、校名和专业,以及显示技能和爱好多选项。

效果图:

首页:

简历制作页面:

首页代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简历制作</title>
    <link rel="stylesheet" href="index.css">
</head>
<body>
    <div class="box">
        <h1>简历制作</h1>
        <form action="page2.php">
            姓 &nbsp; &nbsp; 名:<input type="text" name="username"  class="common" placeholder="请输入姓名"><br><br>
            性 &nbsp; &nbsp; 别:<label><input type="radio" name="sex" id="" value="male" checked>男</label>
                 <label><input type="radio" name="sex" id="gender" value="female">女</label><br><br>
            年 &nbsp; &nbsp; 龄:<input type="number" name="age" id="" class="common" placeholder="请输入年龄(18-60)"><br><br>
            电 &nbsp; &nbsp; 话: &nbsp;<input type="text" name="phonenum" class="common" placeholder="请输入电话"><br><br>
            邮 &nbsp; &nbsp; 箱: &nbsp;<input type="email" name="email" class="common" placeholder="必须@"><br><br>
            联系地址:&nbsp;<input type="text" name="address" class="common" placeholder="请输入联系地址"><br><br>
            邮 &nbsp; &nbsp; 编: &nbsp;<input type="text" name="postcode" class="common" placeholder="请输入邮编"><br><br>
            学 &nbsp; &nbsp; 历:<label class="pl"><input type="radio" name="degree" id="" value="junior" checked>大专</label>
                                 <label class="pl"><input type="radio" name="degree" id="" value="undergraduate">本科</label>
                                 <label class="pl"><input type="radio" name="degree" id="" value="master">硕士</label>
                                 <label class="pl"><input type="radio" name="degree" id="" value="doctor">博士</label><br><br>
            毕业院校:&nbsp;
                <select name="school">
                    <option value="hncst">海软</option>
                    <option value="hnrd">海热</option>
                    <option value="bd">北京大学</option>
                    <option value="qh">清华大学</option>
                    <option value="zkd">中国科学技术大学</option>
                    <option value="hd">海南大学</option>
                </select>
                <br><br>
                专 &nbsp; &nbsp; 业: &nbsp;&nbsp;
                <select name="profession">
                    <option value="software">软件</option>
                    <option value="kj">会计</option>
                    <option value="dm">动漫</option>
                    <option value="wd">舞蹈</option>
                    <option value="jd">机电</option>
                </select>
                <br><br>
                技&nbsp;&nbsp;&nbsp; &nbsp;能:
                <label id="jn"><input type="checkbox" name="skill[]" value="driver" checked id="">开车</label>
                <label id="jn"><input type="checkbox" name="skill[]" value="cook" id="">做菜</label>
                <label id="jn"><input type="checkbox" name="skill[]" value="pinao" id="">弹琴</label>
                <br><br>
                爱&nbsp;&nbsp;&nbsp; &nbsp;好:
                <label id="jn"><input type="checkbox" name="love[]" value="dance" checked id="">跳舞</label>
                <label id="jn"><input type="checkbox" name="love[]" value="sing" id="">唱歌</label>
                <label id="jn"><input type="checkbox" name="love[]" value="chess" id="">下棋</label>
                <label id="jn"><input type="checkbox" name="love[]" value="ball" id="">踢球</label>
                <br><br>
                自我介绍:<br>
                <textarea  name="introduce" cols="55" rows="8" placeholder="请在此输入工作经历等内容...."></textarea><br>
                <input type="reset" value="清空" class="btn1">
                <input type="submit" value="下一步" class="btn2">
        </form>
    </div>
</body>
</html>

首页CSS

*{
    margin: 0;
    overflow: 0;
    box-sizing: border-box;
}

body {
    background-color: #252525;
    background: url(./images/OIP-C.jpg) no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

.box {
    width: 500px;
    /* height: 600px; */
    margin: 50px auto;
    border-radius: 15px;
    background-color: rgba(179, 197, 197,0.7);
    box-shadow: 5px 5px 1px 1px  rgb(178, 226, 244);
}

.box h1 {
    padding-top: 5px;
    font-weight: 400;
    text-align: center;
}

.box form {
    padding-top: 20px;
    padding-left: 25px;
}

.common {
    width: 300px;
    height: 30px;
    border-radius: 5px;
    border: #333;
    padding-left: 10px;
}

#gender , #jn{
    margin-left: 15px;
}

.pl {
    padding-left: 20px;
}
select {
    width: 200px;
    height: 25px;
    border-radius: 5px;
    font-size: 15px;
    background-color: #ececec;
}

textarea {
    margin-top: 10px;
}

.btn1,.btn2 {
    width: 200px;
    height: 40px;
    border-radius: 9px;
    border:0 solid #000;
    margin-top: 5px;
    margin-bottom: 15px;
}

.btn2 {
    margin-left: 15px;
}
.btn1:hover,.btn2:hover{
    font-size: 20px;
    cursor: pointer;
    background-color: antiquewhite;
}

简历制作页面

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.staticfile.net/font-awesome/4.7.0/css/font-awesome.css">
    <title>Document</title>
    <style>
        body{
            background-color: slategray;
        }
        /* 表格 字体颜色 */
        table{
            color: rgb(226, 222, 222);
        }

        .coverage{
            width: 80%;
            margin: 0 auto;
            /* border: 5px solid white; */
            height: 700px;
        }
        /* 插入的图片 */
        .head img{
            width: 300px;
            margin: 0 10px;
        }
        /* 头部左边 照片浮动*/
        .head_left{
            float: left;
            /* margin-top: -12px; */
        }
        /* 头部右边 基本资料 */
        .head_right{
            /* float: right; */
            margin-left: 350px;
        }
        /* 标题 */
        h3{
            width: 136px;
            background-color: rgb(235, 226, 226);
            padding: 0 10px;
            font-size: 25px;
            border-radius: 10px;
            margin: 20px 0px;
        }
        /* 表格中的单元格 */
        table td{
            font-size: 18px;
            /* border: 1px solid white; */
            padding: 6px 0;
        }
        /* 将基本资料中的单元格分为左右两部分 */
        /* 左部分单元格  即姓名性别之类*/
        .tr_left{
            width: 100px;
            text-align: center;
        }
        /* 右部分单元格 即年龄的输出内容*/
        .tr_right{
            width: 280px;
            padding-left: 20px;
        }
        /* 中间盒子*/
        .main{
            padding: 0 10px;
        }
        /* 中间盒子输出内容 */
        .cover{
            /* background-color: white; */
            width: 96%;
            height:50px;
            border-radius: 10px;
            margin-left: 4%;
            font-size: 18px;
            color: rgb(226, 222, 222);
        }
        /* 自我评价输出内容 主要是自我评价内容多,高度多调了一下 */
        .cover_bottom{
            /* background-color: white; */
            width: 96%;
            height:80px;
            border-radius: 10px;
            margin-left: 4%;
            font-size: 18px;
            color: rgb(226, 222, 222);
        }
        /* 底部内容 */
        .bottom{
            margin-top: 3px;
            text-align: center;
            color: rgb(226, 222, 222);
            background-color: #7b8195;
        }
    </style>
</head>
<body>
<?php
    //获取姓名
    $username=$_REQUEST["username"];
    //获取性别
    $sex=$_REQUEST["sex"];
    //获取年龄
    $age=$_REQUEST["age"];
    //获取手机号
    $tel=$_REQUEST["phonenum"];
    //获取邮箱
    $email=$_REQUEST["email"];
    //获取邮编 
    $postcode=$_REQUEST["postcode"];
    //获取地址
    $address=$_REQUEST["address"];
    //获取学校
    $school = $_REQUEST['school'];
    //获取专业
    $profession=$_REQUEST['profession'];
    //获取学历
    $degree=$_REQUEST['degree'];
    //获取技能
    $skill=$_REQUEST['skill'];
    //获取爱好
    $love = $_REQUEST['love'];
    //获取自我介绍
    $introduce = $_REQUEST['introduce'];
    ?>
    <div class="coverage">
        <div class="head">
            <div class="head_left">
                <img src="./images/1.jpg" alt="">
            </div>
            <div class="head_right">
                <h3><i class="fa fa-hand-o-right" style="font-size:36px"></i>基本资料</h3>
                <table>
                    <tr>
                        <td class="tr_left">姓&nbsp;&nbsp;&nbsp;名:</td>
                        <td class="tr_right">
                            <?php
                            //判空
                            if (isset($username)) {
                                echo $username;
                              } else {
                                echo '未输入姓名';
                              }
                            ?>
                        </td>
                        <td class="tr_left">专&nbsp;&nbsp;&nbsp;业:</td>
                        <td class="tr_right">
                            <?php
                                switch($profession){
                                    case "software":
                                        echo "软件";
                                        break;
                                    case "kj":
                                        echo "会计";
                                        break;
                                    case "dm":
                                        echo "动漫";
                                        break;
                                    case "wd":
                                        echo "舞蹈";
                                        break;
                                    case "jd":
                                        echo "机电";
                                        break;
                                }
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="tr_left">性&nbsp;&nbsp;&nbsp;别:</td>
                        <td class="tr_right">
                            <?php
                                if($sex=='male'){
                                    echo "男";
                                }else {
                                    echo '女';
                                }
                            ?>
                        </td>
                        <td class="tr_left">学&nbsp;&nbsp;&nbsp;历:</td>
                        <td class="tr_right">
                            <?php
                                switch($degree){
                                    case "junior":
                                        echo "大专";
                                        break;
                                    case "undergraduate":
                                        echo "本科";
                                        break;
                                    case "master":
                                        echo "硕士";
                                        break;
                                    case "doctor":
                                        echo "博士";
                                        break;
                                }
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="tr_left">年&nbsp;&nbsp;&nbsp;龄:</td>
                        <td class="tr_right">
                        <?php
                            function val_age($input,$min,$max){
                                $age=(int)$input;
                                return $age>=$min && $age<=$max;
                            }
                            $min=18;
                            $max=60;
                            if(val_age($age,$min,$max)){
                                echo $age;
                            }else{
                                echo  "超出范围";
                            }
                        ?>
                        </td>
                        <td class="tr_left">邮&nbsp;&nbsp;&nbsp;编:</td>
                        <td class="tr_right">
                            <?php
                                function val_post($postcode){
                                    return preg_match('/^\d{6}$/', $postcode);
                                }
                                if(val_post($postcode)){
                                    echo  $postcode;
                                }else{
                                    echo"无效邮编";
                                }    
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="tr_left">邮&nbsp;&nbsp;&nbsp;箱:</td>
                        <td class="tr_right">
                            <?php
                                echo $email;
                            ?>
                        </td>
                        <td class="tr_left">联&nbsp;系&nbsp;电&nbsp;话:</td>
                        <td class="tr_right">
                            <?php
                                function val_tel($number){
                                    return preg_match('/^\d{11}$/', $number);
                                }
                                if(val_tel($tel)){
                                    echo $tel;
                                }else{
                                    echo"无效手机号";
                                }
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="tr_left">学&nbsp;&nbsp;&nbsp;校:</td>
                        <td class="tr_right" colspan="3">
                            <?php
                                switch($school){
                                    case "hncst":
                                        echo "海软";
                                        break;
                                    case "hnrd":
                                        echo "海热";
                                        break;
                                    case "bd":
                                        echo "北京大学";
                                        break;
                                    case "qh":
                                        echo "清华大学";
                                        break;
                                    case "zkd":
                                        echo "中国科学技术大学";
                                        break;
                                    case "hd":
                                        echo "海南大学";
                                        break;
                                }
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="tr_left">现居住地:</td>
                        <td class="tr_right" colspan="3">
                            <?php
                                echo $address;
                            ?>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="main">
            <div class="main_1">
                <h3><i class="fa fa-hand-o-right" style="font-size:36px"></i>培训技能</h3>
                <div class="cover">
                    <?php
                        for($i=0;$i<count($skill);$i++){
                            switch($skill[$i]){
                                case "driver":
                                    echo "开车"." " ;
                                break;
                                case "cook":
                                    echo "做菜"." ";
                                break;
                                case "pinao":
                                    echo "弹琴"." ";
                                break;
                            }
                        }
                    ?>    
                </div>
            </div>
            <div class="main_2">
                <h3><i class="fa fa-hand-o-right" style="font-size:36px"></i>兴趣爱好</h3>
                <div class="cover">
                    <?php
                        for($i=0;$i<count($love);$i++){
                            switch($love[$i]){
                                case "dance":
                                    echo "跳舞"." " ;
                                break;
                                case "sing":
                                    echo "唱歌"." ";
                                break;
                                case "chess":
                                    echo "下棋"." ";
                                break;
                                case "ball":
                                    echo "踢球"." ";
                                break;
                            }
                        }
                    ?>
                   
                </div>
            </div>
            <div class="main_3">
                <h3><i class="fa fa-hand-o-right" style="font-size:36px"></i>自我评价</h3>
                <div class="cover_bottom">
                    <?php
                        echo $introduce;
                    ?>
                    
                </div>
            </div>
            <div class="bottom">
                该简历由"敲会代码"小组万某人,孙某人,🐏某人制作完成
            </div>
        </div>
    </div>
</body>
</html>

说明:此项目是笔者在学校的小项目,因为笔者的能力有限,可能会出现很多没有想到的问题,如果您在浏览或者运行代码的时候出现了问题,请您在评论区留言,笔者在看到后会在第一时间处理,谢谢。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1611326.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

SpringBoot项目错误:找不到主类(解决办法)

清理和重新编译项目即可&#xff0c;在项目中点击右键Maven-Reload project&#xff0c;之后再重新运行就行了

MySQL、Oracle查看最大连接数和当前连接数

文章目录 1. MySQL2. Oracle 1. MySQL -- 查看最大连接数 show variables like max_connections; select max_connections; -- select * from performance_schema.session_variables where VARIABLE_NAME in (max_connections); -- select * from performance_schema.global…

SpringCloud 基础配置

1.SpringCloud配置 目前是2024了,笔者也是开始学习SpringCloud 下面是给大家总结的微服务需要的各种依赖的版本 首先我们说一个重点强调 约定 > 配置 > 编码 千万不要一把梭,上来就是干代码,千万记得配置一定得对 2.微服务工程Base构建 首先我们创建父工程 创建出来直接把…

嵌入式Linux开发

(17 封私信 / 1 条消息) 嵌入式Linux应用 - 搜索结果 - 知乎 (zhihu.com)

37. UE5 RPG创建自定义的Ability Task

在前面的文章中&#xff0c;我们实现了一个火球术的一些基本功能&#xff0c;火球术技能的释放&#xff0c;在技能释放后&#xff0c;播放释放动画&#xff0c;在动画播放到需要释放火球术的位置时&#xff0c;将触发动画通知&#xff0c;在动画通知中触发标签事件&#xff0c;…

课时100:正则表达式_基础实践_基础知识

3.1.1 基础知识 学习目标 这一节&#xff0c;我们从 基础知识、简单实践、小结 三个方面来学习 基础知识 需求 我们之前的一些操作&#xff0c;很大程度上都是基于特定的关键字来进行实践的&#xff0c;尤其是面对一些灵活的场景&#xff0c;我们因为过于限定一些关键字&am…

线性代数基础2矩阵

矩阵是什么 矩阵就是二维数组&#xff0c;下面是一个 m 乘 n 的矩阵&#xff0c;它有 m 行&#xff0c;n 列&#xff0c;每行每列上面都有元素&#xff0c;每个元素都有行标i 和列标 j&#xff0c; a ij 。简称m n矩阵&#xff0c;记作&#xff1a; 注意a11的索引是 A[0,0]。…

多模态视觉语言模型:BLIP和BLIP2

1. BLIP BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation BLIP的总体结构如下所示&#xff0c;主要包括三部分&#xff1a; 单模态编码器&#xff08;Image encoder/Text encoder&#xff09;&#xff1a;分别进…

论文笔记:UrbanGPT: Spatio-Temporal Large Language Models

1 intro 时空预测的目标是预测并洞察城市环境随时间和空间不断变化的动态。其目的是预见城市生活多个方面的未来模式、趋势和事件&#xff0c;包括交通、人口流动和犯罪率。虽然已有许多努力致力于开发神经网络技术&#xff0c;以准确预测时空数据&#xff0c;但重要的是要注意…

卷王问卷考试系统/SurveyKing调查系统源码

SurveyKing是一个功能强大的开源调查问卷和考试系统&#xff0c;它能够快速部署并适用于各个行业。 这个系统提供了在线表单设计、数据收集、统计和分析等功能&#xff0c;支持20多种题型&#xff0c;提供多种创建问卷的方式和设置。 项 目 地 址 &#xff1a; runruncode.c…

[阅读笔记16][Orca-2]Teaching Small Language Models How to Reason

接下来是Orca-2&#xff0c;这篇是微软在23年11月发表的论文&#xff0c;在Orca-1的基础上又进行了一些改进。 作者希望教会Orca-2各种推理策略&#xff0c;例如逐步思考、回忆然后回答、先回忆再推理再回答、直接生成回答等等策略。并且Orca-2应该能针对不同任务应该使用最合适…

安装Zipkin

官网&#xff1a;https://zipkin.io/pages/quickstart.html Jar包方式 下载 方式一&#xff1a;百度网盘下载 链接&#xff1a;https://pan.baidu.com/s/1PRV1RamJ8IWX32IJb7jw3Q?pwde8vu 提取码&#xff1a;e8vu 方式二&#xff1a;Central Repository: io/zipkin/zipk…

linux离线安装mysql

一、下载mysql 地址&#xff1a;MySQL 这里选择64为还是32为要根据操作系统来 uname -m 二、上传解压配置mysql 使用root账户登录linux服务器&#xff0c;在opt文件下创建mysql文件夹 cd /opt sudo mkdir mysql 使用Xftp上传mysql压缩包到此文件夹下(自行决定路径) cd mysql/…

李宏毅2022机器学习/深度学习 个人笔记(2)

本系列用于推导、记录该系列视频中本人不熟悉、或认为有价值的知识点 本篇记录第一讲&#xff08;选修&#xff09;&#xff1a;神奇宝贝分类&#xff08;续&#xff09; 如图&#xff0c;boundary变为直线&#xff0c;结果也有上升 我们不一定采用高斯几率模型&#xff0c;…

【C++初识继承】

博主首页&#xff1a; 有趣的中国人 专栏首页&#xff1a; C进阶 本篇文章主要讲解 继承 的相关内容 目录 1. 继承的概念和定义 1.1 继承的概念 1.2 继承的定义 1.2.1 继承定义格式 1.2.2 继承方式与访问修饰限定符 2. 基类和派生类对象赋值转换 3. 继承中的作用域 …

NIMAX下载安装使用,pyvisa基本使用

NIMAX部分&#xff1a; 1、先在NI官网下载系统配置和NI-VISA&#xff1a; 系统配置&#xff1a; https://www.ni.com/zh-cn/support/downloads/drivers/download.system-configuration.html#532687https://www.ni.com/zh-cn/support/downloads/drivers/download.system-conf…

机器学习基本流程

Jupyter Notebook 代码连接&#xff1a; machine_learning_demo machine_learning_ensembles Step 1: Imports and Configuration import pandas as pd import numpy as np import copy import json import pickle import joblib import lightgbm as lgb import optuna impor…

IDEA插件:CodeGeex

前言 CodeGeeX是由清华大学和智谱AI联合开发的多语言代码生成模型。CodeGeeX是一款AI编程助手&#xff0c;其功能类似于Github Copilot、Codeium、CodeWhisperer、Bito等智能编程助手。CodeGeeX支持Python、C、Java、JavaScript、Go等10多种主流编程语言。它可以帮助程…

【小程序】IOS wx小程序解压获取源文件

根据自己手机的系统&#xff0c;获取wx小程序的缓存目录 一、微信小程序文件存放路径 安卓&#xff1a; /data/data/com.tencent.mm/MicroMsg/{{user哈希值}}/appbrand/pkg/iOS越狱&#xff1a; /User/Containers/Data/Application/{{系统UUID}}/Library/WechatPrivate/{{user…

unity学习(89)——unity塞满c盘!--删除editor下的log文件

卸了一个视频后强制续命打开详细信息&#xff1a; 这个再往下找也是没用的&#xff01; 显示隐藏文件夹后&#xff01;执行如下操作&#xff01; 30个g&#xff01; 其中unity占23g editer占了21g 删除C:\Users\王栋林\AppData\Local\Unity\Editor下的log文件 恢复到之前的水…