I was trying to make a php logon page with root password only.
I declared the contents of the logon page with the following contents
config.php
<?php define('hostname','localhost'); define('dbuser','root'); define('dbpass','rootpass123'); define('dbname','infos') //define login credentials define('rootpass','rootuser1'); ?>
Now i wanted to include it in my html i decide to include it in the main php file like this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>login</title> <style type="text/css"> <!-- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } --> </style> </head> <body> <?php require_once(dirname(__FILE__) . "/config.php"); include 'config.php'; if(isset($_POST['submit'])) { if(rootpass!==rootpass1) { print"Wrong Password"; } else{ header("Location: http://www.google.de"); } } ?> <div align="center"> <table width="559" border="0"> <tr> <td width="553"> </td> </tr> <tr> <td><div align="center"> <form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>""> <table width="459" border="0"> <tr> <td width="164"><div align="center"><span class="style1">Root Password </span></div></td> <td width="245"><label> <input name="rootpass" type="password" id="rootpass" /> </label></td> </tr> <tr> <td> </td> <td><label></label></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="login" /></td> </tr> </table> </form> </div></td> </tr> </table> <blockquote> <table width="1149" border="0"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center" class="style1">Soldier Bot © 2014 All Rights Reserved </div></td> </tr> </table> </blockquote> </div> </body> </html>
when i run it i get errors like this
What could go wrong?