国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > 建站經(jīng)驗 > 正文

PHP實現(xiàn)的迷你漂流瓶

2024-04-25 20:40:13
字體:
供稿:網(wǎng)友

本文實例講述了PHP實現(xiàn)的迷你漂流瓶。分享給大家供大家參考。具體如下:

mysql.php:

<?php

mysql_connect('127.0.0.1','root','wjy123') or die('exit(-1)');

mysql_select_db('floatbtn');

mysql_query('set names utf8');

pickbtn.php:

<!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='throwbtn.php'>發(fā)布信息</a>

<form id="form1" name="form1" method="post" action="pickbtn.php">

<table width="80%" border="0">

<?php

@include('mysql.php');

if(isset($_REQUEST['new'])){

$q = 'SELECT * FROM `btn`';

$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['author']?></td>

</tr>

<tr>

<td class="box" >Text : </td>

<td class="box"><?=$re['text'] ?></td>

</tr>

<tr>

<td class="box">Date : </td>

<td class="box"><?=$re['date']?></td>

</tr>

<p class="box">已讀標(biāo)記 <?=$re['flag']?></p>

</table>

<?php

$q = "update `btn` set flag = 1 where id = {$re['id']}";

mysql_query($q);

}

}

?>

<input class="btn" name="new" type="submit" value="截取"/>

</form>

</body>

</html>

throwbtn.php:

<!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>微軟雅黑</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;

}

.box1 {

font-family: "微軟雅黑";

font-size: 12px;

color: #369;

width: 800px;

border: 1px solid #666;

}

</style>

</head>

<body>

<a href='pickbtn.php'>截取信息</a>

<?php

@include('mysql.php');

if(isset($_REQUEST['send'])){

echo 'Publish Successed !<br>';

$author = $_REQUEST['author'];

$text = $_REQUEST['text'];

$date = date('Y-m-d h:m:s');

if(!(null == trim($author)) && !(null == trim($text))) {

$q = "insert into `btn`(`id`,`author`,`text`,`date`,`flag`) values('','$author','$text','$date','0')";

mysql_query($q);

}

}

?>

<form id="form1" name="form1" method="post" action="throwbtn.php">

<table width="80%" border="0">

<tr>

<th class="box" width="110">ID</th>

<td class="box" width="442"><input class="box1" type="text" name="author" /></td>

</tr>

<tr>

<th class="box" >Text</th>

<td class="box"><input class="box1" name="text" type="text" /></td>

</tr>

<tr>

<th class="box">Date</th>

<td class="box">

<input class="box1" type="text" name="date" disabled="disabled" value="<?=date('Y-m-d')?>" /></td>

</tr>

</table>

<div align="center"><input class="btn" name="send" type="submit" value="Send Message"/></div>

</form>

</body>

</html>

希望本文所述對大家的php程序設(shè)計有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 宁城县| 海南省| 德钦县| 瑞金市| 尉氏县| 长宁区| 老河口市| 扶沟县| 枞阳县| 兴城市| 和林格尔县| 乌苏市| 海南省| 武陟县| 沾化县| 洞头县| 长沙市| 湖州市| 聊城市| 武安市| 佛坪县| 三穗县| 平阳县| 郸城县| 海伦市| 潍坊市| 宜丰县| 蒙城县| 额尔古纳市| 扎赉特旗| 普定县| 维西| 辽宁省| 平定县| 开远市| 三亚市| 兴海县| 郸城县| 澳门| 屏南县| 藁城市|