Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP请求返回专业托管服务返回”;在此服务器上找不到请求的URL/“;_Php_Mysqli - Fatal编程技术网

PHP请求返回专业托管服务返回”;在此服务器上找不到请求的URL/“;

PHP请求返回专业托管服务返回”;在此服务器上找不到请求的URL/“;,php,mysqli,Php,Mysqli,我通过weblink和php将客户信息从webplatform Second Life发送到SQL server。我的SQL server由欧洲最大的网络托管公司托管,所以我不希望他们会出错 我已经编写了一个非常简单的PHP脚本,用于为数据库翻译信息,这是我多次成功完成的。这一次发生了一个非常意外的错误:当我测试包含变量的URL时,我得到以下消息:在该服务器上找不到请求的URL/ 这是PHP代码: <?php //You need to insert your specific data

我通过weblink和php将客户信息从webplatform Second Life发送到SQL server。我的SQL server由欧洲最大的网络托管公司托管,所以我不希望他们会出错

我已经编写了一个非常简单的PHP脚本,用于为数据库翻译信息,这是我多次成功完成的。这一次发生了一个非常意外的错误:当我测试包含变量的URL时,我得到以下消息:在该服务器上找不到请求的URL/

这是PHP代码:

<?php

//You need to insert your specific data for "DB_HOSTNAME","DB_USERNAME","DB_PASSWORD","DB_DATABASE"

$con=mysqli_connect("DB_HOSTNAME","DB_USERNAME","DB_PASSWORD","DB_DATABASE");
// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

//use the parameters in the http-link to set the $ variables and real escape them for security reasons 

$key = mysqli_real_escape_string($con, $_GET['key']); 
$name = mysqli_real_escape_string($con, $_GET['name']); 
$pass = mysqli_real_escape_string($con, $_GET['pass']); 
$mailinglist = "1"; 

//Insert the $ variables into the table 
$sql="INSERT INTO SAGS_Global_Players (key, name, pass, mailinglist) VALUES ('$key', '$name', '$pass', '$mailinglist')"; 

//for debugging: print out the db query on the screen
//echo $sql . '<br/>'; 

if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } 


//close connection to database
mysqli_close($con); ?>

如果有任何更改导致此错误,请检查您的.htaccess文件

我将Scott的评论作为答案。如果你想自己做,斯科特,那么我会用最好的答案来标记。我犯了一个最愚蠢的错误:我忘了在链接中的变量前面加一个问号。我真丢脸

您应该了解。将“?”添加到url中。使用“../newplayer.php?key=…”而不是“…/newplayer.php&key=…”。确保在url中保留其余的“&”符号。“第二人生”还没死?哇。@Scott:天哪,问号。。。!我真高兴。非常感谢。我需要新眼镜。@Arkascha:SL每月仍有70万独立用户,去年,通过向其他客户销售虚拟产品,创意个人的总收入为6000万美元。不错,是吗?