<?phpheader("Content-type:text/html;charset=utf-8");//定义变量$name = '小明';$score = 0;$str = '';//点击提交按钮,随机成绩和姓名if($_POST['rand_score']){ //姓名数组 $array_name = array( '0'=>'小明','1'=>'小红','2'=>'小熊','3'=>'小娜','4'=>'小蛋','5'=>.
原创 2021-09-06 11:32:22
99阅读
<?php//字符集header('Content-type:text/html;charset=utf-8');//定义常量,两种方式const DISCOUNT = 0.9;//define("DISCOUNT",0.9);//商品名称$fruit_banana = "香蕉";$fruit_apple = "苹果";$fruit_orange = "桔子";//购买数量$weight_banana = 2;$weight_apple = 1;$weight_orange.
原创 2021-09-06 11:32:23
103阅读
<html><head> <meta charset="UTF-8"> <title>服务器信息</title></head><body> <table> <tr> <th colspan="2">服务器信息展示</th> </tr> <tr> .
原创 2021-09-06 11:32:24
129阅读
今天我们来谈谈关于Linux、PHP和MySQL的案例教程。这三个技术是互联网开发中非常常用的技术,如果你有兴趣学习互联网开发,那么这些技术一定是你必须要掌握的。在这篇文章中,我们将通过一个简单的案例来介绍如何在Linux环境下搭建一个基于PHP和MySQL的网站。 首先,我们需要准备一个Linux服务器,可以选择使用虚拟机或者云服务器。接着,我们需要安装Apache、PHP和MySQL这三个软
原创 2024-04-29 11:27:46
86阅读
<?php//case 16 用户注册/* * 建表SQL语句 * *create table emp_user( id int unsigned auto_increment primary key, user_name varchar(10) not null unique, password char(32) not null, email varchar(40) not null)charset=utf8; * * * */?&gt.
原创 2021-09-06 11:32:11
115阅读
<?phpheader("Content-type:text/html;charset=utf-8");echo "<h2>闰年的判断</h2>";$year = 0;//Get方式获取数据if(isset($_GET['ok'])){ $year = (int)$_GET['years'];}//判断条件,方式一if (($year % 4 == 0) && ($year % 100 != 0) || ($year % 400 .
原创 2021-09-06 11:32:21
214阅读
这个代码有点多,比较复杂;先在工程项目里,添加一个文件夹(library_1),然后将下面的代码都建立在这个文件夹中统一管理。首页 index.php<?php//case 33 模型类//引用自动加载页require_once './init.php';//调用model方法$stu = model('emp_info');//查询$data = $stu->field('emp_name,emp_dept')->select();echo "<pre
原创 2021-09-06 11:32:37
59阅读
t195.php<?php//case 10 网页布局//定义常量,防止直接访问引入页面define('WEBTEST','test1');?><html><head> <meta charset="UTF-8"> <title>网页布局</title> //样式表 <style type="text/css" rel="stylesheet"> .title
原创 2021-09-06 11:32:16
200阅读
<?php//case 20 用户登录/** * * * * * */?><html><head> <title>用户登录</title></head><body><form method="post" action="./t209.php"> <sapn> 用户名:<input type="text" name="user_name.
原创 2021-09-06 11:36:51
143阅读
<?php//case 17 用户信息编辑/* * 建表SQL语句create table emp_userinfo( id int unsigned auto_increment primary key, --主键 nick_name varchar(10) not null, --昵称 gender enum('男性','女性','中性') not null, --性别 email varchar(40) not null, -- 邮箱 q.
原创 2021-09-06 11:32:10
239阅读
<?php//case 5 打印金字塔//当前行$line = 1;//空格数$empty = 1;//星数$star = 1;//塔总行数$total_line = 30;echo "<table>";//总循环while($line <= $total_line){ //空格数计算 $empty = $total_line - $line; //星数计算 $star = 2 * $line - 1; //空格当.
原创 2021-09-06 11:32:20
288阅读
这个演示项目,我把文件夹目录建立的简单,没有分层级,都是同级目录。根目录cms_1。根目录 一级目录 二级目录 cms_1 lib ueditor article_add.php article_del.php article_edit.php article_show.php category.php ...
原创 2021-09-06 11:32:33
163阅读
<?php//case 35 PDO基本使用/** * 建表sql语句 *create table emp_books(book_id int unsigned auto_increment primary key,book_name varchar(20) not null comment '书名',book_author varchar(15) comment '作者',pub_time varchar(10) comment '出版日期')charset = utf8;.
原创 2021-09-06 11:32:35
91阅读
<?php//case 19 保存浏览历史//虚拟新闻数组$all_data = array( 1=>array('学习php','月薪万元不是梦','......'), 2=>array('学习java','日薪万元不是梦','......'), 3=>array('我是程序员','成为高富帅,迎娶白富美','......'), 4=>array('学习编程的终极奥义','秃头秃头再秃头','.....'));//获取新闻id$i.
原创 2021-09-06 11:36:51
56阅读
<?php//case 14 分页显示信息/* *建立数据表的sql语句 * * create table emp_info( emp_id int unsigned auto_increment primary key, emp_name varchar(20) not null, emp_dept varchar(20) not null, date_birth timestamp not null, date_entry timestamp .
原创 2021-09-06 11:32:13
105阅读
<?php//case 8 显示订单信息header("Content-type:text/html;charset=utf-8");//多维数组$goods = array( array('name'=>'主板','price'=>'779','producing'=>'广东','num'=>4), array('name'=>'显卡','price'=>'1299','producing'=>'深圳','num'=>2),.
原创 2021-09-06 11:32:18
248阅读
<?php//case 7 获取文件后缀header('Content-type:text/html;charset=utf-8');//文件路径$path = '';//提交,获得文件名称if(isset($_POST['up_file1'])){ $path = $_FILES['file1']['name'];}//调用函数,获取后缀$ext = getFileExt($path);echo "<h2>获取文件后缀</h2>";ech.
原创 2021-09-06 11:32:19
74阅读
<?php//case 36 预处理语句/** * 建表sql语句 *create table emp_books(book_id int unsigned auto_increment primary key,book_name varchar(20) not null comment '书名',book_author varchar(15) comment '作者',pub_time varchar(10) comment '出版日期')charset = utf8; * .
原创 2021-09-06 11:32:35
105阅读
t220.php<?php//case 30 静态工具类class tool1{ /** * @param $info * @param $url */ public static function alertGo($info,$url) { echo "<script>alert('$info');location.href='$url';</script>"; exit();
原创 2021-09-06 11:32:39
74阅读
t218.php<?php//case 29 文件上传类//上传类class upload{ //私有,文件类型数组 private $allow_types = array('image/jpeg','image/pjpeg','image/png','image/x-png','image/gif'); //文件尺寸 private $max_size = 1048576; //图片目录 private $upload_path = '
原创 2021-09-06 11:32:40
68阅读
  • 1
  • 2
  • 3
  • 4
  • 5