header("content-type:text/html;charset=utf-8");//設(shè)置頁面內(nèi)容是html編碼格式是utf-8
? ? //1.接收數(shù)據(jù)
? ? $name = $_POST['name'];
? ? $tel = $_POST['tel'];
? ? //數(shù)據(jù)插入的天龍八部
? ? //1.數(shù)據(jù)庫連接
? ? $pdo = new PDO('mysql:host=sh-cdb-anr5wfga.sql.tencentcdb.com;dbname=collect_information;port=63512','dbmodify','IFreshwing2018!');
? ? $pdo->exec('set names utf8');
? ? // $link = mysql_connect("sh-cdb-anr5wfga.sql.tencentcdb.com:63512","dbmodify","IFreshwing2018!","collect_information") or die("數(shù)據(jù)庫連接失敗");
? ? if($pdo->exec('insert into information (name,tel,information_sources) values("'.$name.'","'.$tel.'","永新官網(wǎng)")')){
? ? ? ? echo 100;
? ? }else{
? ? ? ? echo 1001;
? ? }