so i need a script so when someone enters my url it requires a user name and password before you can see the index. this is gonna be used for like my portfolio and what not paid or free either way let me know reps to all that help
I don't think you'll need an extra secure system for your portfolio, so this script will be helpfull for you. Don't forget to set real login, password and path (url) to file Here's working example of this script http://www.chossonandkallah.com/tests/pass.php login user and password password <!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>Password protected page</title> </head> <body> <?php // Define your username and password and path to file $username = "user"; $password = "password"; $path = "pass.php"; if ($_POST['username'] != $username || $_POST['password'] != $password): ?> <h1>Login</h1> <form name="form" method="post" action="about:blank" onsubmit="this.action='<?php echo $path; ?>'"> <p><label for="username">Username:</label> <br /><input type="text" title="Enter your Username" name="username" /></p> <p><label for="password">Password:</label> <br /><input type="password" title="Enter your password" name="password" /></p> <p><input type="submit" name="Submit" value="Login" /></p> </form> <?php else: ?> <p>This is the protected page. Your private content goes here.</p> <?php endif; ?> </body> </html> PHP: