欢迎各位兄弟 发布技术文章
这里的技术是共享的
<?php
header("Content-Type: text/html; charset=utf-8");
$uid = $_COOKIE['uid'];
$pwd = $_COOKIE['pwd'];
$bool_power = false;
if($drupal_uid && $drupal_user){
$link = mysqli_connect(
'localhost', /* The host to connect to 连接MySQL地址 */
'root', /* The user to connect as 连接MySQL用户名 */
'123456', /* The password to use 连接MySQL密码 */
'abcde'); /*这是数据库名称*/
if (!$link) {
}else{
$link->query("set names utf8");
$result = mysqli_query($link, "SELECT uid FROM users WHERE uid='$uid' and pwd='$pwd'");
if($result){
$row = mysqli_fetch_assoc($result);
if($row){
$bool_power = true;
}
mysqli_free_result($result);
}
mysqli_close($link);
}
}
if(!$bool_power){
die("连不到数据库或者数据库里面没有数据");
}