Bitte sagen Sie mir, was schief gelaufen ist, wenn das Einreichungsformular leer ist.
 
  2017-12-04 19:45:52
0
7
1772

<?php

if(trim($_POST['password']) != trim($_POST['repassword'])){

exit ("Die doppelt verwendeten Passwörter sind inkonsistent, bitte kehren Sie zum vorherigen zurück Seite ");

}

$username = trim($_POST['username']);

$password = md5(trim($_POST['password']));

$conn = mysqli_connect('localhost','root','root','informationtest','3306');

if(mysqli_error($conn)){

mysqli_error($conn);

beenden ;

}

mysqli_select_db($conn,'my_my');

mysqli_set_charset($conn,'utf8');

insert into informationtest (id,name,password,) value(' ' ,'$Benutzername','$Passwort');

?>


 
 

Antworte allen(2)
dabour

你是直接访问了那个文件,而不是通过服务器访问的

  • Antwort 是的,谢谢我解决了
      Autor 2017-12-09 18:50:46
路过

那你要看看html 是不是没有name

  • Antwort 有name,后来我发现除了火狐,其他浏览器是直接显示php代码
      Autor 2017-12-05 18:24:57
  • Antwort &lt;html&gt; &lt;body&gt; &lt;form action=&quot;connect.php&quot; method=&quot;POST&quot;&gt; &lt;table border=&quot;1&quot; style=&quot;margin:100px auto&quot;&gt; &lt;tr&gt; &lt;td&gt;用户名&lt;/td&gt; &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;密码&lt;/td&gt; &lt;td&gt;&lt;input type=&quot;password&quot; name=&quot;password&quot; /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan=2 align = center&gt;&lt;input type=&quot;submit&quot; value=&quot;注册&quot; name=&quot;submit&quot; /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; //以上是html代码
      Autor 2017-12-05 18:27:51
  • Antwort 搞定了,百度的:直接localhost访问网站目录 假设你有一个静态页index.html,将静态页拷到你的网站目录,然后是用localhost/index.html访问
      Autor 2017-12-05 19:23:57
  • Antwort 我用Notepad++打开浏览器的,显示的地址是file:///D:/phpStudy/PHPTutorial/WWW/login.html这样的,不是localhost/login.html,所以导致html跳转直接显示php代码。虽然解决了,但是原理还是懵逼。
      Autor 2017-12-05 19:26:11
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage