Home php教程 PHP源码 迷你PHP漂流瓶原型

迷你PHP漂流瓶原型

May 25, 2016 pm 05:11 PM

1.php代码

<?phpmysql_connect(&#39;127.0.0.1&#39;,&#39;root&#39;,&#39;wjy123&#39;) or die(&#39;exit(-1)&#39;);
mysql_select_db(&#39;floatbtn&#39;);
mysql_query(&#39;set names utf8&#39;);
Copy after login

2.代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ppick u</title>
<style type="text/css">
.btn {
	font-family: "微软雅黑";
	font-size: 12px;
	color: #FFF;
	background-color: #369;
	border: 1px solid #666;
}
.box {
	font-family: "微软雅黑";
	color: #369;
	font-size: 12px;
	border: 1px solid #369;
}
</style>
</head>

<body>
<a href=&#39;throwbtn.php&#39;>发布信息</a>
<form id="form1" name="form1" method="post" action="pickbtn.php">
<table width="80%" border="0">
<?php@include(&#39;mysql.php&#39;);
if(isset($_REQUEST[&#39;new&#39;])){
$q = &#39;SELECT * FROM `btn`&#39;;
$rs = mysql_query($q);
$max = mysql_num_rows($rs);
$rd = rand(1,$max);
$q = "select * from `btn` where id = {$rd}";
$rs = mysql_query($q);
while($re = mysql_fetch_array($rs)){
?>
  <tr>
    <td class="box" width="12%">ID : </td>
    <td class="box" width="88%"><?=$re[&#39;author&#39;]?></td>
  </tr>
  <tr>
    <td class="box" >Text : </td>
    <td class="box"><?=$re[&#39;text&#39;] ?></td>
  </tr>
  <tr>
    <td class="box">Date : </td>
    <td class="box"><?=$re[&#39;date&#39;]?></td>
  </tr>
  <p class="box">已读标记 <?=$re[&#39;flag&#39;]?></p>
</table>
<?php$q = "update `btn` set flag = 1 where id = {$re[&#39;id&#39;]}";
mysql_query($q);
}
}
?>
<input class="btn" name="new" type="submit" value="截取"/>
</form>
</body>
</html>
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1269
29
C# Tutorial
1249
24