Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/274.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页面_Php_Post - Fatal编程技术网

无法将值发布到php页面

无法将值发布到php页面,php,post,Php,Post,我正在开发一个php web服务,它应该接受一些参数作为post,但不知何故它不接受任何作为post发送的变量。任何人都可以检查我的代码,让我知道我犯的错误 <?php echo "register string\n"; require_once('config.php'); // Create connection $con=mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_DATABASE); // Check connection if (

我正在开发一个php web服务,它应该接受一些参数作为post,但不知何故它不接受任何作为post发送的变量。任何人都可以检查我的代码,让我知道我犯的错误

<?php
echo "register string\n";
require_once('config.php');
// Create connection
$con=mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_DATABASE);

// Check connection
if (mysqli_connect_errno()){
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
echo "test 123\n";

function clean($str) {
    $str = @trim($str);
    if(get_magic_quotes_gpc()) {
        $str = stripslashes($str);
    }
    return mysql_real_escape_string($str);
}

$fbid = clean($_POST['fbid']);
echo $fbid;
$fname = clean($_POST['first_name']);
echo $fname;
寄存器串 测试123 注意:第23行的/home/tapoint/public_html/tapadmin/webservices/register.php中未定义索引:fbid 警告:mysql_real_escape_string:第20行的/home/tapoint/public_html/tapadmin/webservices/register.php中使用密码:NO拒绝用户“tapoint”@“localhost”的访问 警告:mysql\u real\u escape\u字符串:无法在第20行的/home/tapoint/public\u html/tapadmin/webservices/register.php中建立到服务器的链接 注意:未定义索引:第25行/home/tapoint/public\u html/tapadmin/webservices/register.php中的first_name 警告:mysql_real_escape_string:第20行的/home/tapoint/public_html/tapadmin/webservices/register.php中使用密码:NO拒绝用户“tapoint”@“localhost”的访问 警告:mysql\u real\u escape\u字符串:无法在第20行的/home/tapoint/public\u html/tapadmin/webservices/register.php中建立到服务器的链接

问候
Pankaj

trim不会产生任何级别的错误。不需要@Try error\u reportingE\u ALL;在第一行查看是否出现问题,并打印帖子;要查看您得到了哪些POST变量,我在POST中没有收到任何内容,并且收到一些错误。您是否检查您是否确实在执行POST请求?您可以使用浏览器中的开发工具对其进行检查。
Array