When I try to open the file register.php
from the localhost(localhost/PrimaAppAndroid/register.php), the page remains white, and if I try to see the source file it is empty. If I leave the php part from register.php
, it works fine even if I don't change the extension php in html.
I have seen a similar question and I added AddType application/x-httpd-php .php
at the end of my apache2.conf
file but nothing changed. How can fix this?
Here the sources: register.php
<?php
/*
Our "config.inc.php" file connects to database every time we include or require
it within a php script. Since we want this script to add a new user to our db,
we will be talking with our database, and therefore,
let's require the connection to happen:
*/
require("config.inc.php");
?>
<h1>Register</h1>
<form action="register.php" method="post">
Username:<br />
<input type="text" name="username" value="" />
<br /><br />
Password:<br />
<input type="password" name="password" value="" />
<br /><br />
<input type="submit" value="Register New User" />
</form>
config.inc.php:
<?php
// These variables define the connection information for your MySQL database
$username = "root"
$password = "root"
$host = "localhost"
$dbname = "cinemapreverificasql"
// Tis is the way we saw in class
$conn = mysql_connect($host, $username, $password) or die("Errore nella connessione MySQL");
mysql_select_db($dbname, $conn) or ide("Database inesistente");
?>