Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 51

Thread: Kick-out script...

  1. #11
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    Well I'm not used to PHP and no nothing about it. I downloaded the/a program PHP and don't know how to use it. What should I do about the HTAccess, because I want it to block certain pages on my site not my computer. I don't really know what I'm doing and asking. Anyone that wants to be an administrator on my site and help me out can. Just email me please. The PM on DynamicDrive isn't working for me. Thanks.
    -Nicolas-

    __________________________________________________________________________
    I enjoy helping, but I suck at it!
    __________________________________________________________________________

  2. #12
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    But you probably know about as much about htaccess as you do php and I think more people here know php than htaccess so you can get more help via php.

    try making a php file (anyname.php) and saving it with the following


    PHP Code:
    <?php
    if ( isset($_POST['username']) && isset($_POST['password'])) {
    if (
    $_POST['username']=="carfreak" && $_POST['password']=="CHANGETHIS") {
        
    header("Location: testlogin.htm");
    }
    if (
    $_POST['username']=="lovegirl" && $_POST['password']=="CHANGETHIS") { 
        
    header("Location: testlogin.htm");
     }
    if (
    $_POST['username']=="sample" && $_POST['password']=="CHANGETHIS") { 
        
    header("Location: nothere.htm");
    }
    if (
    $_POST['username']== && $_POST['password']=="CHANGETHIS") { 
        
    header("Location: CPANEL=304935609023q840943903258fg094et9ig0r9e.htm");
    }
    if (
    $_POST['username']== && $_POST['password']=="CHANGETHIS") { 
        
    header("Location: yay.htm");
    }
    }
    ?>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1">
    <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
    <title>Test-Login.html</title>
    </head>
    <body>
    <form name="login" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
         <div align="center">
              <center>
                   <table width="225" cellpadding="3" border="1">
                        <tbody>
                             <tr>
                                  <td colspan="2"><font size="5"><b>Members-Only Area!</b></font></td>
                             </tr>
                             <tr>
                                  <td>Username:</td>
                                  <td><input type="text" name="username" size="20"></td>
                             </tr>
                             <tr>
                                  <td>Password:</td>
                                  <td><input type="text" name="password" size="20"></td>
                             </tr>
                             <tr>
                                  <td align="center" colspan="2"><input type="button" onclick="Login()" value="Login!"></td>
                             </tr>
                        </tbody>
                   </table>
              </center>
         </div>
    </form>
    <p align="center"><font face="arial, helvetica" size="1">Or </font><a href="http://kapleenmusic.webfreehosting.net"><font face="arial, helvetica" size="1">Register</font></a></p>
    </body>
    </html>
    Corrections to my coding/thoughts welcome.

  3. #13
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    Well, the page came up and I had the login box, but I couldn't login
    I edited the passwords, and that did nothing.
    By the way, I encrypted the HTML on that page, how did you still see the code?
    -[Nic]-

  4. #14
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by [Nicolas] View Post
    By the way, I encrypted the HTML on that page, how did you still see the code?
    -[Nic]-
    same way the browser does. "encrypting" your source code accomplishes nothing, except slowing the page load slightly and being a mild annoyance to people who are trying to help you fix your source code.

  5. #15
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    The headers may need to be absolute (full address, http://www.site.com/page.html) try switching that. If that doesn't work please post the code as you've inputted it and a link.

    "Encrypting" your source code you can't/didn't do, you changed the language (or the display mode of it I forget the actual phrasing for it). If you block the source code from being readable than no user/computer can see your web page so there is no point in having it online. If your source code is readable by the browser it will be viewable by the user, no way around that.
    Corrections to my coding/thoughts welcome.

  6. #16
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    PHP Code:
    <?php
    if ( isset($_POST['username']) && isset($_POST['password'])) {
    if (
    $_POST['username']=="foo" && $_POST['password']=="password") { 
        
    header("Location: http://kapleenmusic.webfreehosting.net/CPANEL=304935609023q840943903258fg094et9ig0r9e.htm");
    }
    ?>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1">
    <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
    <title>Test-Login.html</title>
    </head>
    <body>
    <form name="login" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
         <div align="center">
              <center>
                   <table width="225" cellpadding="3" border="1">
                        <tbody>
                             <tr>
                                  <td colspan="2"><font size="5"><b>Members-Only Area!</b></font></td>
                             </tr>
                             <tr>
                                  <td>Username:</td>
                                  <td><input type="text" name="username" size="20"></td>
                             </tr>
                             <tr>
                                  <td>Password:</td>
                                  <td><input type="text" name="password" size="20"></td>
                             </tr>
                             <tr>
                                  <td align="center" colspan="2"><input type="button" onclick="Login()" value="Login!"></td>
                             </tr>
                        </tbody>
                   </table>
              </center>
         </div>
    </form>
    <p align="center"><font face="arial, helvetica" size="1">Or </font><a href="http://kapleenmusic.webfreehosting.net"><font 

    face="arial, helvetica" size="1">Register</font></a></p>
    </body>
    </html>
    That's the full code, here's the link.
    Last edited by [Nicolas]; 09-13-2010 at 04:17 PM.

  7. #17
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Your missing the second closing bracket

    PHP Code:
    }
    ?> 
    should be

    PHP Code:
    }
    }
    ?> 
    Corrections to my coding/thoughts welcome.

  8. #18
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    Still didn't work

  9. #19
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Ooo, You still have JS in the submit button change:


    Code:
     <td align="center" colspan="2"><input type="button" onclick="Login()" value="Login!"></td>
    to

    Code:
     <td align="center" colspan="2"><input type="submit" value="Login!"></td>
    Corrections to my coding/thoughts welcome.

  10. #20
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by firefox
    File not found

    Firefox can't find the file at /C:/Documents and Settings/*******/Desktop/<?php echo $_SERVER['PHP_SELF'];?>.

    * Check the file name for capitalization or other typing errors.

    * Check to see if the file was moved, renamed or deleted.
    Wah The login button worked this time, but now it's going to a link I didn't add.
    Now how do I fix this?
    Once again, the login button worked but it's going to a link I didn't add...
    Help appreciated. Thanks.
    -[Nic]-

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
  •