Zubrag.com :: Forum

Programmers Lounge => PHP / MySql / Smarty Questions => Topic started by: Ginger on May 12, 2008, 11:55:12 PM



Title: Changin background colour of Password protect
Post by: Ginger on May 12, 2008, 11:55:12 PM
Hello clever people.

How do I change the background colour to black and box+type to white in Password_protect?

Ginger


Title: Re: Changin background colour of Password protect
Post by: PapaBearPW on May 13, 2008, 04:33:26 AM
You should be able to change the look of the login page inside password_protect.php. Just go to the html section in that file. There you should also be able to add in your own css in order to make it have the same look and feel as the rest of your site.

password_protect.php lines 98-119:
Code:
<html>
<head>
  <title>Please enter password to access this page</title>
  <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</head>
<body>
  <style>
    input { border: 1px solid black; }
  </style>
  <div style="width:500px; margin-left:auto; margin-right:auto; text-align:center">
  <form method="post">
    <h3>Please enter password to access this page</h3>
    <font color="red"><?php echo $error_msg?></font><br />
<?php if (USE_USERNAME) echo 'Login:<br /><input type="input" name="access_login" /><br />Password:<br />'?>
    <input type="password" name="access_password" /><p></p><input type="submit" name="Submit" value="Submit" />
  </form>
  <br />
  <a style="font-size:9px; color: #B0B0B0; font-family: Verdana, Arial;" href="http://www.zubrag.com/scripts/password-protect.php" title="Download Password Protector">Powered by Password Protect</a>
  </div>
</body>
</html>

For my purposes I simply added my css file to the head section like so:

Code:
<html>
<head>
  <title>Please enter password to access this page</title>
  <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
  <link rel="stylesheet" href="head/mycss.css">
</head>

If you aren't using an external css file, you can alternatively add the css info like this:

Code:
<html>
<head>
  <title>Please enter password to access this page</title>
  <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
  <style type="text/css">
    body {
      color: #ffffff;
      background-color: #000000;
      font-family: tahoma,helvetica;
    }
  </style>
</head>

I personally prefer to use css, but you could also change the appearance changing the following html attributes:

Code:
<body bgcolor="black">

or

Code:
<body bgcolor="#000000">

Then enter whatever font colors you wish for the text by wrapping the text in font tags like this:

Code:
  <form method="post">
    <h3><font color="#ffffff">Please enter password to access this page</font></h3>
    <font color="red"><?php echo $error_msg?></font><br />
<?php if (USE_USERNAME) echo '<font color="#ffffff">Login:<br /><input type="input" name="access_login" /><br />Password:</font><br />'?>

Good Luck


Title: Re: Changin background colour of Password protect
Post by: Vilice on July 14, 2008, 11:20:22 PM
Many thanks .It's so kind of you  :P


Title: Re: Changin background colour of Password protect
Post by: Sky on May 31, 2009, 06:48:22 AM
thank you very much :)