我需要放置一个 php 代码以获取变量形式的回发 url(http://example.com?r=joe&s=19 ,然后将其放入我的 mysql 数据库中。我可以知道我错过了什么吗?
提前致谢。
$DBHost = "localhost";
$DBUser = "useridofmysql";
$DBPassword = "passofmysql";
$DBDatabase = "databaseofmysql";
$user = @$_GET['r'];
$age = @$_GET['s'];
$mymysql = mysql_connect($DBHost,$DBUser,$DBPassword) or die;
mysql_select_db($DBDatabase, $mymysql) or die("Could not select database");
mysql_query("INSERT INTO `postback`(username, age)VALUES('$user', '$age')");
mysql_close($mymysql);