简体   繁体   English

php文件在localhost服务器中工作,但不在cpanel中工作

[英]php file working in localhost server but not in cpanel

 if($_SERVER['REQUEST_METHOD']=='POST'){

//this is my database //这是我的数据库

 include 'db.php'; 

 $con = mysqli_connect($servername,$username,$password,$dbname);

//inputs //输入

 $email = $_POST['email'];
 $password = $_POST['password'];
 $phone = $_POST['phone'];

//checking query //检查查询

 $Sql_Query = "select * from user_info where email = '$email' and password   = '$password' and phone = '$phone' ";


 $check = mysqli_fetch_array(mysqli_query($con,$Sql_Query));

 if(isset($check)){

 echo "Data Matched";
 }
 else{
 echo "Invalid combination of Username or Phone and Password ! Please Try     Again";
 }

 }else{
 echo "Check Again";
 }

//closing //结束

mysqli_close($con);

what is the error, please help me out I'm stuck 错误是什么,请帮我解决

Please set the root path to include. 请设置要包含的根路径。

<?php include('db.php'); ?> 

Your issue may be resolved. 您的问题可能已解决。

If the issue is only on server , the following might help you: 如果问题仅在server上,则以下内容可能对您有帮助:

  1. Check mysqli is enabled on server or not. 检查mysqli是否在服务器上启用。
  2. Recheck username, password and dbname. 重新检查用户名,密码和数据库名。
  3. Check if your db contains a table named user_info if so check column names also. 检查数据库是否包含一个名为user_info的表,如果是的话,还要检查列名。
  4. Try debugging using echo 123;exit; 尝试使用echo 123;exit;调试 , and find where the code breaks.. ,然后找到代码中断的位置。
  5. Also check error log file. 还要检查错误日志文件。

Hope this helps you. 希望这对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PHP LOGIN脚本在Xampp本地主机上工作,但在Cpanel上不工作 - PHP LOGIN script Working on Xampp localhost but not on Cpanel jQuery Ajax在本地主机(xammp)上运行但在服务器(cpanel)上不运行? - Jquery Ajax working on localhost (xammp) but not working on Server (cpanel)? 在哪里可以找到本地主机和实时服务器上的 CPANEL object 文件路径 - Where to find CPANEL object file Path on Localhost and Live server 在PHP Server cpanel中设置启动文件 - Set startup file in PHP Server cpanel 强制文件下载代码在本地主机上工作,但在 php 中的实际服务器上不工作 - force file download code work on localhost but not working on actual server in php PHP 中的 zipArchive 在服务器中不起作用,但在 localhost 上运行并提取文件 - zipArchive in PHP is not working in server but on localhost runs and extracts the file PHP地理编码正在本地主机上运行,​​但不在服务器上运行 - PHP geocode is working on localhost but not on server php不在localhost上工作但在web服务器上工作? - php not working on localhost but on web server? PHP代码可在localhost上运行,但不能在服务器上运行 - PHP code working on localhost but not on server php cron作业在cPanel服务器上工作正常,但在非cPanel服务器上给出错误 - php cron jobs working fine on cPanel server but giving errors on non cPanel server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM