| Hello and Welcome to Tech Support Team! Before you can start posting and answering questions, you'll have to register. Registration is fast, simple and absolutely free! Feel free to browse through existing questions by choosing the forum you want to visit below. | | |  | 
12th November 2008, 08:28 PM
|  | Newcomer | | Join Date: Nov 2008, 23 posts. Location: Hull, UK Reputation:  | | | Password protect a page
Hi,
I have a file uploader that only i want to use e.g. http://www.mysite.com/files/upload.php but i want there to be a password protection so a password protection so no one else can use it.
Something either like a php script to insert into my uploader script before i can upload something or a webpage that if the password is correct takes that page to the uploader.
but if i host an image or something on another site e.g http://www.mysite.com/files/image.jpg i still want them to be able to view it on a site or forum and be able to view in its own but not be able to go to http://www.mysite.com/files/upload.php without entering a password
| 
12th November 2008, 08:34 PM
|  | TST Oracle | | Join Date: Jul 2008, 8,171 posts. Location: UK Norfolk ..... Reputation:  | | |
You need Dudeking
oh Eddie
where are you ???
__________________ Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, chocolate in one hand, wine in the other, body thoroughly used up, totally worn out and screaming...
Damn, What a ride!! | 
12th November 2008, 09:35 PM
|  | TST Enthusiast | | Join Date: Jul 2008, 279 posts. Reputation:  | | |
Why not use .htaccess and .htpasswd on the folder that holds the page you want to protect from others seeing
| 
12th November 2008, 09:47 PM
|  | TST Expert | | Join Date: Jul 2008, 583 posts. Location: Nottingham, UK Reputation:  | |
Forget htaccess lol it will block your images as well if you don't do it properly.
Go for somthing like this...errrr.. PHP Code: <?php
if(isset($_POST['submit'])){
$password = 'yourpassword';
if($password == $_POST['typedpassword']){
//add upload script here
}else{
echo 'wrong password';
}
}else{
echo'<form action="thispage.php" method="post">
<input type="password" name="typedpassword" />
<input type="submit" name="submit" value="Login" />
</form>';
}
?>
Not tested it but thats the basic idea
| 
17th November 2008, 10:29 PM
|  | TST Enthusiast | | Join Date: Sep 2008, 295 posts. Location: Michigan Reputation:  | | |
You can more than likely find this by googling, which can give you many different types of password protecting codes.
Good luck iTouch
__________________
"People think at the end of the day that a man is the only answer [to fulfillment]. Actually a job is better for me."
—Princess Diana | 
18th November 2008, 10:43 AM
|  | TST Expert | | Join Date: Jul 2008, 583 posts. Location: Nottingham, UK Reputation:  | |
Have you managed this mate? Just modifi the script and add that in, its better than .htaccess beacuse you have everything in one place. Also with most scripts you find on google will be javascript...which can be hacked in less than a second. | 
18th November 2008, 12:40 PM
|  | TST Enthusiast | | Join Date: Sep 2008, 295 posts. Location: Michigan Reputation:  | |
Ah, didn't know that dudeking, thanks for letting me know!!  Go with what dudeking says, he knows what he's talking about.
__________________
"People think at the end of the day that a man is the only answer [to fulfillment]. Actually a job is better for me."
—Princess Diana | 
18th November 2008, 07:37 PM
|  | TST Expert | | Join Date: Jul 2008, 583 posts. Location: Nottingham, UK Reputation:  | | |
Yeah, simple one user hard coded PHP passwords in my opinion are about the hardest to hack. Once they get any more complicated with databases and things and multiple users things like SQL injection can be used to hack them and with simple javascript ones, they can usually be hacked just by reading the source code.
| 
18th November 2008, 08:35 PM
|  | TST Master | | Join Date: Dec 2007, 2,107 posts. Location: England Reputation:  | |
For added protection you could rar all your files and set a password when you compress them.
__________________ "If at first you do not succeed, sit down, have a coffee, have a smoke, and think for a bit. If that still doesn't work, post it on TST". | 
8th December 2008, 10:29 AM
|  | Newcomer | | Join Date: Nov 2008, 23 posts. Location: Hull, UK Reputation:  | | |
It does work perfect thanks
| 
8th December 2008, 05:33 PM
|  | TST Expert | | Join Date: Jul 2008, 583 posts. Location: Nottingham, UK Reputation:  | | |
Awesome!! let me know if u need any more help
|  | Only registered members can participate in forum threads. You must register or log in to contribute. All times are GMT. The time now is 01:54 PM.
| |
|