on my website http://www.cams-revision.info/ (please look at it to know what I am talking about), I have made a login page but I don't have a clue how to move the login box and text and align it to the centre of the page. I am using PHP (with index.inc.php, index.php & style.css) and the text in my index.inc.php is as follows:
<?php
// Define your username and password
$username = "xxxxxxxxxx";
$password = "**********";
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
?>
#apDiv1 {
position:absolute;
left:494px;
top:138px;
width:577px;
height:226px;
z-index:1;
}
-->
</style>
</head>
<body>
<div id="apDiv1">
<div align="center"><font face="calibri">Please Login to Start Revising</font></div>
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p><label for="txtUsername"><font face="calibri">Username:</font></label>
<br /><input type="text" title="Enter your Username" name="txtUsername" /></p>
<p><label for="txtpassword"><font face="calibri">Password:</font></label>
<br /><input type="password" title="Enter your password" name="txtPassword" /></p>
<p><input type="submit" name="Submit" value="Login" /></p>
</form>
<?php
}
else {
?>
<p><?php
if (basename(__FILE__) == basename($_SERVER['PHP_SELF']))
{
exit(0);
}
echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<!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" lang="en-US" xml:lang="en-US">
<a href="http://www.thegamehomepage.com/play/quake-reloaded/" target="_blank">Play Quake Reloaded</a>
<head>
<link rel="shortcut icon" href="favicon.ico" />
<title>Cam's Proxy</title>
<link rel="stylesheet" type="text/css" href="style.css" title="Default Theme" media="all" />
<meta name="google-site-verification" content="RsRGf7AMGXP5UDv2cuK2Ayok6OdOSSX-AM493OuY4_E" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="favicon.ico">
</head>
<body onload="document.getElementById('address_box').focus()">
<div id="container">
<h1 id="title">Cam's Proxy</h1>
<ul id="navigation">
<li><a href="<?php echo $GLOBALS['_script_base'] ?>">URL Form</a></li>
<li><a href="javascript:alert('cookie managment has not been implemented yet')">Manage Cookies</a></li>
</ul>
<?php
switch ($data['category'])
{
case 'auth':
?>
<div id="auth"><p>
<b>Enter your username and password for "<?php echo htmlspecialchars($data['realm']) ?>" on <?php echo
$GLOBALS['_url_parts']['host'] ?></b>
<form method="post" action="">
<input type="hidden" name="<?php echo $GLOBALS['_config']['basic_auth_var_name'] ?>" value="<?php echo
base64_encode($data['realm']) ?>" />
<label>Username <input type="text" name="username" value="" /></label> <label>Password <input
type="password" name="password" value="" /></label> <input type="submit" value="Login" />
</form></p></div>
<?php
break;
case 'error':
echo '<div id="error"><p>';
switch ($data['group'])
{
case 'url':
echo '<b>URL Error (' . $data['error'] . ')</b>: ';
switch ($data['type'])
{
case 'internal':
$message = 'Failed to connect to the specified host. '
. 'Possible problems are that the server was not found, the connection
timed out, or the connection refused by the host. '
. 'Try connecting again and check if the address is correct.';
break;
case 'external':
switch ($data['error'])
{
case 1:
$message = 'The URL you\'re attempting to access is blacklisted by this
server. Please select another URL.';
break;
case 2:
$message = 'The URL you entered is malformed. Please check whether you
entered the correct URL or not.';
break;
}
break;
}
break;
case 'resource':
echo '<b>Resource Error:</b> ';
switch ($data['type'])
{
case 'file_size':
$message = 'The file your are attempting to download is too large.<br />'
. 'Maxiumum permissible file size is <b>' . number_format($GLOBALS
['_config']['max_file_size']/1048576, 2) . ' MB</b><br />'
. 'Requested file size is <
BTW I would also like to know how to get rid of those annoying error messages!!!
<?php
// Define your username and password
$username = "xxxxxxxxxx";
$password = "**********";
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
?>
#apDiv1 {
position:absolute;
left:494px;
top:138px;
width:577px;
height:226px;
z-index:1;
}
-->
</style>
</head>
<body>
<div id="apDiv1">
<div align="center"><font face="calibri">Please Login to Start Revising</font></div>
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p><label for="txtUsername"><font face="calibri">Username:</font></label>
<br /><input type="text" title="Enter your Username" name="txtUsername" /></p>
<p><label for="txtpassword"><font face="calibri">Password:</font></label>
<br /><input type="password" title="Enter your password" name="txtPassword" /></p>
<p><input type="submit" name="Submit" value="Login" /></p>
</form>
<?php
}
else {
?>
<p><?php
if (basename(__FILE__) == basename($_SERVER['PHP_SELF']))
{
exit(0);
}
echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<!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" lang="en-US" xml:lang="en-US">
<a href="http://www.thegamehomepage.com/play/quake-reloaded/" target="_blank">Play Quake Reloaded</a>
<head>
<link rel="shortcut icon" href="favicon.ico" />
<title>Cam's Proxy</title>
<link rel="stylesheet" type="text/css" href="style.css" title="Default Theme" media="all" />
<meta name="google-site-verification" content="RsRGf7AMGXP5UDv2cuK2Ayok6OdOSSX-AM493OuY4_E" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="favicon.ico">
</head>
<body onload="document.getElementById('address_box').focus()">
<div id="container">
<h1 id="title">Cam's Proxy</h1>
<ul id="navigation">
<li><a href="<?php echo $GLOBALS['_script_base'] ?>">URL Form</a></li>
<li><a href="javascript:alert('cookie managment has not been implemented yet')">Manage Cookies</a></li>
</ul>
<?php
switch ($data['category'])
{
case 'auth':
?>
<div id="auth"><p>
<b>Enter your username and password for "<?php echo htmlspecialchars($data['realm']) ?>" on <?php echo
$GLOBALS['_url_parts']['host'] ?></b>
<form method="post" action="">
<input type="hidden" name="<?php echo $GLOBALS['_config']['basic_auth_var_name'] ?>" value="<?php echo
base64_encode($data['realm']) ?>" />
<label>Username <input type="text" name="username" value="" /></label> <label>Password <input
type="password" name="password" value="" /></label> <input type="submit" value="Login" />
</form></p></div>
<?php
break;
case 'error':
echo '<div id="error"><p>';
switch ($data['group'])
{
case 'url':
echo '<b>URL Error (' . $data['error'] . ')</b>: ';
switch ($data['type'])
{
case 'internal':
$message = 'Failed to connect to the specified host. '
. 'Possible problems are that the server was not found, the connection
timed out, or the connection refused by the host. '
. 'Try connecting again and check if the address is correct.';
break;
case 'external':
switch ($data['error'])
{
case 1:
$message = 'The URL you\'re attempting to access is blacklisted by this
server. Please select another URL.';
break;
case 2:
$message = 'The URL you entered is malformed. Please check whether you
entered the correct URL or not.';
break;
}
break;
}
break;
case 'resource':
echo '<b>Resource Error:</b> ';
switch ($data['type'])
{
case 'file_size':
$message = 'The file your are attempting to download is too large.<br />'
. 'Maxiumum permissible file size is <b>' . number_format($GLOBALS
['_config']['max_file_size']/1048576, 2) . ' MB</b><br />'
. 'Requested file size is <
BTW I would also like to know how to get rid of those annoying error messages!!!