doudu161481 2018-05-05 20:53 采纳率: 100%
浏览 61

端口80上的连接被拒绝重定向到文件

I got a question:
I got a webservice (table) indeed I can add remove and edit some records with php.
Behind each button there is a PHP file, like edit.php, delete.php and so one.
If I want to edit a record I get the following message displayed on my browser:

ERR_CONNECTION_REFUSED - localhost refused the connection

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//

The problem will be executed on this line:

 if($query1)
 {
     header("Location:http://localhost/dash/blood.php");

What I did
I changed localhost to the Server IP and it did not worked.
Even if I removed dash and just added blood.php it did not worked equal same error.

CMD:
Later on I executed the following command on cmd:
Result:

  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


Are these connections the cause for my displayed error notification?
And if so, do I have to close these connections?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)