我有一个问题:
我有一个webservice(表)确实我可以添加删除和编辑一些记录与PHP。
每个按钮后面都有一个PHP文件,比如edit.php,delete.php等等。
如果我想编辑记录,我会在浏览器上显示以下消息:
ERR_CONNECTION_REFUSED - localhost拒绝连接
EDIT.php:
<?php
ob_start();
include'connect.php';
?>
<?php
if(isset($_POST['submit']))
{
$con=mysqli_connect("localhost","user","pw","db");
$first=mysqli_real_escape_string($con, $_POST['first']);
$last=mysqli_real_escape_string($con, $_POST['last']);
$phone=mysqli_real_escape_string($con, $_POST['phone']);
$age=mysqli_real_escape_string($con, $_POST['age']);
$gender=mysqli_real_escape_string($con, $_POST['gender']);
$blood=mysqli_real_escape_string($con, $_POST['blood']);
$occupation=mysqli_real_escape_string($con, $_POST['occupation']);
$qualification=mysqli_real_escape_string($con, $_POST['qualification']);
$address=mysqli_real_escape_string($con, $_POST['address']);
$city=mysqli_real_escape_string($con, $_POST['city']);
if(!empty($_FILES['image']))
{
$ext = pathinfo($_FILES['image']['name'],PATHINFO_EXTENSION);
$image = time().'.'.$ext;
move_uploaded_file($_FILES["image"]["tmp_name"], 'images/'.$image);
//echo $image;
}
else
{
echo "Image Is Empty";
}
$query1=mysqli_query($con, "insert into register values('','$first','$last','$phone','$age','$gender','$blood','$occupation','$qualification','$address','$image','$city')");
//echo "insert into addd values('','$name','$age')";
if($query1)
{
header("Location:http://localhost/dash/blood.php");
ob_end_flush();
die();
}
}
?>
<!DOCTYPE html>//HTML//
问题将在这一行执行:
if($query1)
{
header("Location:http://localhost/dash/blood.php");
我做了什么
我将localhost更改为服务器IP,但它没有用。
即使我删除了破折号并且刚刚添加了blood.php它也没有同样的错误。
CMD:
后来我在cmd上执行了以下命令:
结果:
TCP 192.168.1.107:56487 93.184.220.29:80 WAIT 0
TCP 192.168.1.107:56494 193.247.41.48:80 WAIT 0
TCP 192.168.1.107:56512 185.73.44.35:80 SYN_SENT 6448
这些连接是否是我显示的错误通知的原因?
如果是这样,我是否必须关闭这些连接?