php制作的bbs超经典
Lepaskan: 2016-07-25 08:48:36
asal
1249 orang telah melayarinya
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);
- }
- ?>
复制代码
|
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Artikel terbaru oleh pengarang
-
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
Topik-topik yang berkaitan
Lagi>