php制作的bbs超经典(全文在这里)http://115.com/lb/5lbcqol0flze
- $dsn = "mysql:host=localhost;dbname=数据库名";
- $dbh = new PDO($dsn, '用户名', '密码', array(PDO::ATTR_PERSISTENT => true));
- $dbh -> query("SET NAMES 'utf8'; ");
-
- $id=$_POST['id'];
- $username = $_SESSION['username']; //获取回帖人的相关信息
- $sql = "select * from user where username= '$username'";
- $result = mysql_query($sql);
- $row = mysql_fetch_array($result);
- $row['score']=$row['score'] 2;
- mysql_query("update user set score = '".$row['score']."' where username ='".$row['username']."'");
-
-
- $content = $_POST['content'];//获取回帖的相关信息
- //$email = $row['email'];
- $date = date("Y-m-d H:i:s");
-
- $date=date("y-m-d H:i");
- date_default_timezone_set("Asia/Shanghai");
- $time = date('Y-m-d H:m:s');
- $y=date("Y",strtotime($time));
- $m=date("m",strtotime($time));
- $d=date("d",strtotime($time));
- $h=date("H",strtotime($time));
- $w=date("w",strtotime($time));
- //$weekNumber=intval(date('W'));
- //$url = "http://api.map.baidu.com/geocoder?location={$weidu},{$jingdu}&output=json";
- //$json = json_decode(file_get_contents($url), TRUE);
- //$a=file_get_contents($url);
- //$province = $json['result']['addressComponent']['province'];
- //$city = $json['result']['addressComponent']['city'];
- $sql=" insert into 表名(文章ID,内容, 名字, 时间)values('$id', '$content', '$username', now())";
- //$result=mysql_query($sql);
- if ($dbh -> query($sql)) {
- header("Content-Type:Application/json");
- $arr = array('status' => 'ok');
- echo json_encode($arr);
- }
- ?>
复制代码
|
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
作者最新文章
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31