php by oneself

时间:2022-10-23 17:17:11

在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的更多相关文章

  1. Introduce oneself

    首先,我是一个男生, 我很喜欢打游戏,钟爱LOL,接触它已经7年了.虽然还是很菜,但就是喜欢.选择计算机科学与技术这个专业呢,就是因为喜欢电脑,可以和室友一起开黑,然而室友都不玩,有点难受. 此外呢, ...

  2. Crystal Clear Applied&colon; The Seven Properties of Running an Agile Project &lpar;转载&rpar;

    作者Alistair Cockburn, Crystal Clear的7个成功要素,写得挺好. 敏捷方法的关注点,大家可以参考,太激动所以转载了. 原文:http://www.informit.com ...

  3. 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 ...

  4. Practical oral English

    1.如果你继续发烧,我就去请医生过来If your fever continues, I'll send for the doctor.2.在这么大的停车场里,我是永远都找不到我的车的I'll nev ...

  5. R自动数据收集第二章HTML笔记1&lpar;主要关于handler处理器函数和帮助文档所有示例&rpar;

    本文知识点:     1潜在畸形页面使用htmlTreeParse函数 2startElement的用法 3闭包 4handler函数的命令和函数体主要写法 5节点的丢弃,取出,取出标签名称.属性.属 ...

  6. 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 ...

  7. 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 ...

  8. HDU 1536 S-Nim SG博弈

    S-Nim Problem Description   Arthur and his sister Caroll have been playing a game called Nim for som ...

  9. &lbrack;转载&rsqb;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 ...

随机推荐

  1. JavaScript创建对象及对象继承

    面向对象的语言有一个标志,那就是他们都有类的概念,而通过类可以创建任意多个具有相同属性和方法的对象.但是在ECMAScript中没有类的概念,因此它的对象也与基于类的对象有所不同.实际上,JavaSc ...

  2. python——argsort函数

    numpy中argsort函数用法,有需要的朋友可以参考下. 在Python中使用help帮助 >>> import numpy >>> help(numpy.ar ...

  3. Mysql远程登录授权

    1.改表法. 请使用mysql管理工具,如:SQLyog Enterprise 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑使用mysql管理工 ...

  4. js数据结构与算法--单链表的实现与应用思考

    链表是动态的数据结构,它的每个元素由一个存储元素本身的节点和一个指向下一个元素的引用(也称指针或链接)组成. 现实中,有一些链表的例子. 第一个就是寻宝的游戏.你有一条线索,这条线索是指向寻找下一条线 ...

  5. h264&lowbar;rtp打包解包类及实现demo

    打包头文件: class CH2642Rtp { public: CH2642Rtp(uint32_t ssrc, uint8_t payloadType = 96, uint8_t fps = 25 ...

  6. vue&period;&dollar;nextTick 解决了哪些问题

    转载:https://www.cnblogs.com/xuewuhen/p/7860989.html $nextTick 是在下次 DOM 更新循环结束之后执行延迟回调,在修改数据之后使用 $next ...

  7. Java NIO系列教程(十一) Pipe

    Java NIO 管道是2个线程之间的单向数据连接.Pipe有一个source通道和一个sink通道.数据会被写到sink通道,从source通道读取. 这里是Pipe原理的图示: 创建管道 通过Pi ...

  8. mysql的内存使用

    Mysql Server Memory Usage = Sum of Global Buffers + (number of Connection * Per thread memory variab ...

  9. java&period;lang&period;Error&colon; Unresolved compilation problem&colon; 解决方案

    严重: Allocate exception for servlet WX_Interfacejava.lang.Error: Unresolved compilation problem: The ...

  10. OC - 缓存 - NSCache - 介绍