Ejemplo n.º 1
0
<?php

/*
 *
 *	@Description:	每次刷新网页都给出一句提示语
 *	@Author:	贾朝藤
 *
 *
 */
include "database.php";
$db = new db_operation();
$db->db_use_db('tips', 'utf8');
$tips = $db->db_select('tips');
$tips_num = count($tips) - 1;
//产生随机数
$rand_num = rand(0, $tips_num - 1);
//调用新浪API,获取所在地信息
include "../Get_ip_area/GetIpArea_sina.php";
?>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Tips-everyaccess</title>

	<style type="text/css">
		
		*{
			font-family: Tahoma, "Microsoft Yahei", Arial;
		}

		table{
Ejemplo n.º 2
0
<?php

require "DBOperation/DBOperation.php";
$Obj = new db_operation();
$Obj->conn_db();
$subtask_id = $_POST['subtask_id'];
$status_id = $_POST['status_id'];
$srtquery = 'update task  set status_id =' . $status_id . "where task_id=" . $subtask_id;
mysql_query($sqlstatment) or die(mysql_error());
Ejemplo n.º 3
0
<?php

/*
 *
 *	@Description:	xx在xx做xx(例如:张三在学校看书)
 *	@Author:	localtest
 *
 */
//$where_rand_num = rand( 0, 65535 );
//$what_rand_num = rand( 0, 65535 );
//包含数据库操作类
include "database.php";
$db = new db_operation();
$db->db_use_db('rand_app_tx', 'utf8');
//随机显示的 内容数组
$what_content = $db->db_select('rand_what');
//随机显示的 出现地点数组
$where_content = $db->db_select('rand_where');
array_pop($what_content);
array_pop($where_content);
//元素个数
$what_count = count($what_content);
//元素个数
$where_count = count($where_content);
//内容 随机数
$rand_what_num = rand(0, $what_count - 1);
//地点 随机数
$rand_where_num = rand(0, $where_count - 1);
//print_r( $rand_what_num );
//echo "<br/>";
//print_r( $rand_where_num );