php by oneself
在php里面写html代码真的很麻烦,最近学到了一个新的方法:
<html>
<head>
<title>PHP</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
</head>
<body>
<?php
for($i=0;$i<5;$i++){
?>
<table>
<tr>
<td>语文</td>
<td>数学</td>
</tr>
<tr>
<td>90</td>
<td>89</td>
</tr>
</table>
<?php
}
?>
</body>
</html>
WAMPSEVER是个很轻大的软件,集合了Apache、PHP、MySQL,用起来也方便;
在PHPstorm里面导入MySQL也方便:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
</head>
<body>
<?php
if(@$_POST['submit']){
$name = $_POST['name'];
$sex = $_POST['sex'];
$add = $_POST['add'];
$conn = @mysql_connect("localhost","root","root") or die("数据库连接失败,请检查你的网络,稍后再试试");
mysql_select_db("students");
mysql_query("set names 'utf8'"); $sql = "INSERT INTO `test`.`students` (`id`,`name`, `sex`, `add`) VALUES (NULL, '$name', '$sex', '$add')";
mysql_query($sql); }
?> <form action="studAdd01.php" method="post">
用户名: <input type="text" name="name"/> <br/>
性别: <input type="text" name="sex"/> <br/>
住址: <input type="text" name="add"/><br/>
<input type="submit" name="submit" value="提交"/> <br/>
</form>
</body>
</html>
php by oneself的更多相关文章
- Introduce oneself
首先,我是一个男生, 我很喜欢打游戏,钟爱LOL,接触它已经7年了.虽然还是很菜,但就是喜欢.选择计算机科学与技术这个专业呢,就是因为喜欢电脑,可以和室友一起开黑,然而室友都不玩,有点难受. 此外呢, ...
- Crystal Clear Applied: The Seven Properties of Running an Agile Project (转载)
作者Alistair Cockburn, Crystal Clear的7个成功要素,写得挺好. 敏捷方法的关注点,大家可以参考,太激动所以转载了. 原文:http://www.informit.com ...
- Lesson 22 A glass envolops
Text My daughter, Jane, never dreamed of receiving a letter from a girl of her own age in Holland. L ...
- Practical oral English
1.如果你继续发烧,我就去请医生过来If your fever continues, I'll send for the doctor.2.在这么大的停车场里,我是永远都找不到我的车的I'll nev ...
- R自动数据收集第二章HTML笔记1(主要关于handler处理器函数和帮助文档所有示例)
本文知识点: 1潜在畸形页面使用htmlTreeParse函数 2startElement的用法 3闭包 4handler函数的命令和函数体主要写法 5节点的丢弃,取出,取出标签名称.属性.属 ...
- Lesson 10 Not for jazz
Text We have an old musical instrument. It is called a clavichord. It was made in Germany in 1681. O ...
- Lesson 1 A private conversation
Text Last week I went to the theatre. I had a very good seat. The play was very intersting. I did no ...
- HDU 1536 S-Nim SG博弈
S-Nim Problem Description Arthur and his sister Caroll have been playing a game called Nim for som ...
- [转载]Three Trending Computer Vision Research Areas, 从CVPR看接下来几年的CV的发展趋势
As I walked through the large poster-filled hall at CVPR 2013, I asked myself, “Quo vadis Computer V ...
随机推荐
- CQRS及.NET中的参考资料
(此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:CQRS作为一种设计模式,其实一点都不新鲜了.不过今天有朋友感叹.NET朋友也关注CQ ...
- 在IIS上部署SSL
背景: 在处理DropboxAPI开发时,其重定向的URL地址必须是https的[除了localhost],不得已在自己网站上加了ssl,下面简单介绍下添加自签名证书,毕竟只是临时使用. 1.打开II ...
- 无法打开包括文件:“windows.h”: No such file or directory
VS2012 出现如下错误: 无法打开包括文件:"windows.h": No such file or directory 解决办法,将 C:\Program Files ...
- Get open Popups
public IEnumerable<Popup> GetOpenPopups() { return PresentationSource.CurrentSources.OfType< ...
- I/O复用模型之epoll学习
简介: epoll是linux下多路复用I/O接口select/poll的增强版,它能够显著提高程序在大量并发连接中只有少量活跃的情况下的系统cpu利用率,原因是它会复用文件描述符集合来传递结果而不用 ...
- Js图片切换
<!DOCTYPE html><html<head> <meta charset="UTF-8"> <title></t ...
- Adobe Flash Media Server安装
Flash Media Server(FMS)是一个流媒体服务器 使用 实时消息传送协议(RTMP),RTMP是一种未加密的TCP/IP协议,专门设计用来高速传送音频.视频和数据信息. 3.5版32位 ...
- 某app客户端数字签名分析
最近测试app时发现某app对数据包做了签名,其直接后果就导致截获的数据包没法修改,因此对该app的数字签名了进行了一次分析.
- JavaScript入门(2)
encodeURI()和 decodeURI()作用 编码与解码 encodeURIComponent()和 decodeURIComponent()作用区别是 后者可以处理一些特殊字符进行转义 ...
- Uva12206 Stammering Aliens 后缀数组&&Hash
Dr. Ellie Arroway has established contact with an extraterrestrial civilization. However, all effort ...