Jump to content

Recommended Posts

Hello

I have a php script which basically is a FTP script allowing me to upload, download, delete etc. but i you can only perform these actions in the directory that the php script is in.

I want to put it in my main directory where my index etc. is.

To access it i would put http://mydomain.co.uk/admin.php.

In doing this though it would allow anyone who goes to http://mydomain.co.uk/admin.php would be able to perform the actions i mentioned above which could result in them deleting my whole site.

Could anyone tell me how i can password protect that php file.

 

Thank you

Tom Bullock

 

Note: I cannot password protect the main directory because people would be asked for a password when they go to http://my domain.co.uk

Link to comment
https://forums.phpfreaks.com/topic/71262-password-protection/
Share on other sites

SESSIONS.

 

http://www.tizag.com/phpT/phpsessions.php

 

On the page, use a session variable to see if the user is logged in. If not, present a login form. On POST, if the login credentials are correct, set a session variable saying "user is logged in" and display the protected info.

Link to comment
https://forums.phpfreaks.com/topic/71262-password-protection/#findComment-358446
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.