I’m writing a site for a few friends who don’t know how to code. I don’t want to write on my localhost because I want them to be able to see the site’s progress. I would like to write on the site itself. How would I go about setting up a simple password system so that only they are able to see the site? Although this isn’t secure at all, this is the best I could think of:
site.com/index.php:
<body>
<form type="POST" action="/redirect.php">
<input type="text" name="textbox">
<input type="submit" value="submit">
</form>
</body>
site.com/redirect.php:
<?php
if ($_POST['textbox'] == 'password123'){
//redirect to site.com/actualSite/index.php
}
?>
I have two quick and dirty suggestions for you.
Limit by IP –
Limit by a password in
$_GETparameter –Now all your teammates have to do is append the password to their URL like so –
https://myCoolNewSite.com?pass=4815162342Please know that these are not extremely complex methods of securing a URL but for your needs. to temporarily limit access during development – they might just be enough. Quick and dirty 😉