updata.php

来自「侃侃 实在是说不出深刻的东西哈」· PHP 代码 · 共 22 行

PHP
22
字号
<?php
function getip() { 
	$IP=getenv('REMOTE_ADDR'); 
	$IP_ = getenv('HTTP_X_FORWARDED_FOR'); 
	if (($IP_ != "") && ($IP_ != "unknown")) $IP=$IP_; 
	return $IP; 
} 
  require('config.php');
  $name=$_POST['user_name']; 
  $ip=getip();
  $info=$_POST['post_info'];  
  $title=$_POST['post_title']; 
  $time=date("Y-m-d H:i:s");
  $conn=mysql_connect($host,$user,$password); 
   mysql_query("set names GB2312"); //解决中文乱码问题 
   mysql_select_db($db); 
   $exec="insert into gbooktable (name,ip,title,info,time) values ('$name','$ip','$title','$info','$time')"; 
   $result=mysql_query($exec);
   mysql_close();
   header("location:index.php");
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?