Home  >  Q&A  >  body text

Question: All other outputs are normal, but the error output is garbled!

<?php/** * Created by runner.han * There is nothing new under the sun */header('Content-type:text/html;charset=utf-8'); include_once 'header.php';include_once 'inc/config.inc.php ';$dbhost=DBHOST;$dbuser=DBUSER;$dbpw=DBPW;$dbname=DBNAME;$dbport=DBPORT;$mes_connect='';$mes_create='';$mes_data='';$mes_ok='' ;if(isset($_POST['submit'])){ $link = mysqli_connect($dbhost, $dbuser, $dbpw,$dbport); //Judge the database connection //if(!@mysqli_connect($dbhost, $ dbuser, $dbpw)){ //if(!@mysqli_connect("localhost", "root", "root", "13306")){ if(!$link){ echo 'Data connection failed, please check carefully inc /config.inc.php configuration'; echo "Error: Unable to connect to MySQL." . PHP_EOL; echo "Debugging errno: " . mysqli_connect_errno() ; exit(mysqli_connect_error()); } $link=mysqli_connect(DBHOST, DBUSER, DBPW); $mes_connect.="<p class='notice'>Database connection successful!

";

lsllsl1591 days ago1161

reply all(8)I'll reply

  • Guanhui

    Guanhui2020-05-13 11:07:47

    Is your mysql character set set to UTF-8?

    reply
    0
  • lsl

    Once set, normal use of cmd mysql -u -p -P is a normal connection and normal reading and writing.

    lsl · 2020-05-13 11:08:55
  • lsl

    lsl2020-05-12 01:03:43

    2Picture2image.png

    reply
    0
  • lsl

    lsl2020-05-12 01:02:40

    1.试了很多方法都乱码.png

    reply
    0
  • lsl

    lsl2020-05-12 01:01:03

    Why can’t the picture be uploaded

    reply
    0
  • Storms

    What error is reported? Is the image size in the configuration file exceeded?

    Storms · 2020-05-14 11:30:25
  • lsl

    lsl2020-05-12 00:59:38

    reply
    0
  • lsl

    lsl2020-05-12 00:56:55

    reply
    0
  • Cancelreply