PHP file doens't reload [closed]

I'm running a lamp server to develop php. Everything was just working fine until I tried my script. I have a html form file which after being submitted to the server leads to a php file, the html file works just fine, however, I can't say the same thing to the php file. After submitting the form I'm getting a pure blank page with 0 lines of code when viewing the page source. I've already veryfied that both of the files are in my root directory /var/www/html. I've also confirmed that the html page was pointing to the correct php file, checked both of the file names, restarted apache2 server and cleared my cache. None of these worked. Do you have any more ideas? Thanks for your time, berga007

Some samples of my code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>1 st Registation form!</title> <!--begining of internal css--> <style> #p1 { font-family: verdana; color: red; font-size: 25px; text-align: center; } p { font-family: verdana; color: blue; font-size: 15px; text-align: left; }
</style>
</head>
<body>
<!--Register.html registation form using xhtml-->
<p id= "p1">Please complete this form to submit your registation in our website:</p>
<form action= "handle_reg.php" method= "post">
...
</form>
</body>
</html>

And now some samples of my php code

<html xmlns="" xml:lang="en" lang="en">
<head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Your registation</title>
</head>
<body>
<?php //Display errors and error reporting ini_set ('display_errors, 1'); error_reporting (E_ALL ~E_NOTICE); //Register Globals disabled $first_name=$_POST['first_name']; $last_name=$_POST['last_name']; $email=$_POST['email']; $password=$_POST['password']; $confirm_password=['confirm_password']; $color=$_POST['color']; $month=$_POST['month']; $day=$_POST['day']; $year=$_POST['year']; print '<p>Registation results: </p>'; ...
?>
</body>
</html> 
4

1 Answer

Did you check the apache2 error log?

There is a typo in your php code. You are missing the &. Correct is:

// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);

I highly suggest for development systems to set

display_errors = On
display_startup_errors = On
error_reporting = E_ALL

in your php.ini as I mentioned in the comments earlier.

You Might Also Like