-1

Here is my code.

<!DOCTYPE=HTML>
<html>
<head>
</head>
<body>
<?php
require("connect.php") or die("failed to connect to server.");

if (isset($_POST['submit'])){
echo'Goodwork!';
}else{

echo'<form action="signup.php" method="POST">
Fistname: <input type="text" name="fname"/></br>
Lastname: <input type="text" name="lname"/></br>
Phone Number: <input type="text" name="phonenumber"/></br>
Email: <input type="text" name="email1"/></br>
Confirm Email: <input type="text" name="email2"/></br>
Password: <input type="password" name="pass1"/></br>
Confirm Password: <input type="password" name="pass2"/></br>
<input type="submit" name="submit">
</form>';


}

?>
</body>
</html>

However when I run this the browser just gives me a white page with no form. I have tried taking away the "if (isset($_POST['submit'])){echo'Goodwork!';}" bit but have had no luck. What is up with my PHP?

  • Check the file extension is .php. If it is, try creating a blank php file with `phpinfo();` in it, and loading it on your web server, to check that PHP is correctly installed. – Matt Maclennan Jul 16 '14 at 07:57
  • 1
    http://php.net/manual/en/function.error-reporting.php – DarkBee Jul 16 '14 at 07:57
  • Are you using XAMPP or WAMP for your php environmnet. If using XAMPP, please make sure that you saved the file in the xampp/htdocs folder and if using WAMP ensure that you saved it in the WWW folder. – kya Jul 16 '14 at 07:58
  • Put error reporting on - `ini_set('display_errors', 1); error_reporting(E_ALL);` – Darren Jul 16 '14 at 07:58
  • See [this duplicate](http://stackoverflow.com/questions/1163473/require-once-or-die-not-working). `or` is not necessary for `require` and is giving you a fatal error, ie the white screen of death. – Mark Miller Jul 16 '14 at 07:58
  • do you have created connect.php? if yes then check for the path. you have included it as require. if it does not reach to the file, it will stop the execution. – Pramod Jul 16 '14 at 07:58

1 Answers1

0

Check your connect.php and put die("failed to connect to server."); statement in connect.php file and execute it when your mysql_connect(); failed to connect with database.

GTS Soft.
  • 187
  • 4