Results 1 to 2 of 2

Thread: How can I increase the size of the textbox in this script?

  1. #1
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default How can I increase the size of the textbox in this script?

    When I tried writing this "<textarea cols=10 name=message rows=1></textarea>" it created a second textbox and of course I only want the one box.


    PHP Code:
    <?php
    // show usage example
    if(isset($_GET['help'])) {
    die(
    'Include following code into every page you would like to protect, at the very beginning (first line):<br>&lt;?php include("' str_replace('\\','\\\\',__FILE__) . '"); ?&gt;');
    }

    // timeout in seconds
    $timeout = (TIMEOUT_MINUTES == time() + TIMEOUT_MINUTES 60);

    // logout?
    if(isset($_GET['logout'])) {
    setcookie("verify"''$timeout'/'); // clear password;
    header('Location: ' LOGOUT_URL);
    exit();
    }

    if(!
    function_exists('showLoginPasswordProtect')) {

    // show login form
    function showLoginPasswordProtect($error_msg) {
    ?>
    <html>
    <head>
    <title></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">
    <h2>This page is now password protected just for you,.</h2><br><br>
    <h3>Who is your <br>(Capitalization counts!)</h3>
    <font color="red"><?php echo $error_msg?></font><br />
    <?php if (USE_USERNAME) echo 'Login:<br /><input type="input" name="access_login" /><br />Answer :<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>

    <?php
    // stop at this point
    die();
    }
    }

    // user provided password
    if (isset($_POST['access_password'])) {

    $login = isset($_POST['access_login']) ? $_POST['access_login'] : '';
    $pass $_POST['access_password'];
    if (!
    USE_USERNAME && !in_array($pass$LOGIN_INFORMATION)
    || (
    USE_USERNAME && ( !array_key_exists($login$LOGIN_INFORMATION) || $LOGIN_INFORMATION[$login] != $pass ) ) 
    ) {
    showLoginPasswordProtect("Incorrect answer.");
    }
    else {
    // set cookie if password was validated
    // setcookie("verify", md5($login.'%'.$pass), $timeout, '/');

    // Some programs (like Form1 Bilder) check $_POST array to see if parameters passed
    // So need to clear password protector variables
    unset($_POST['access_login']);
    unset(
    $_POST['access_password']);
    unset(
    $_POST['Submit']);
    }

    }

    else {

    // check if password cookie is set
    if (!isset($_COOKIE['verify'])) {
    showLoginPasswordProtect("");
    }

    // check if cookie is good
    $found false;
    foreach(
    $LOGIN_INFORMATION as $key=>$val) {
    $lp = (USE_USERNAME $key '') .'%'.$val;
    if (
    $_COOKIE['verify'] == md5($lp)) {
    $found true;
    // prolong timeout
    if (TIMEOUT_CHECK_ACTIVITY) {
    setcookie("verify"md5($lp), $timeout'/');
    }
    break;
    }
    }
    if (!
    $found) {
    showLoginPasswordProtect("");
    }

    }

    ?>
    Last edited by tech_support; 03-03-2008 at 05:13 AM. Reason: Wrapped code in [php][/php] tags.

  2. #2
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    I finally found the answer to my own question. Maybe it will help someone else sometime. I added this

    size="60" style="width: 99%;" maxlength="80"

    to this line

    <input type="password" name="access_password" />


    and wa-la.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •