| | |
Allowing one user at a time to access a particular PHP Page
![]() |
Dear Forum,
Thanks for taking time reading this post.
I checked out on sessions and cookies but I guess they are more towards the client side?
Is there a way to achieve this:
The PHP program I am doing is to reverse Telnet (Terminal Server and it accessing through CONSOLE port) into a router from a selection of a dropdown list box. Once this user had successfully logged into the router, other users(different computer) will NOT be able to even see this same logged on router as a selection to log in again.
I hope you can understand my question.
Thanks alot people!
Thanks for taking time reading this post.
I checked out on sessions and cookies but I guess they are more towards the client side?
Is there a way to achieve this:
The PHP program I am doing is to reverse Telnet (Terminal Server and it accessing through CONSOLE port) into a router from a selection of a dropdown list box. Once this user had successfully logged into the router, other users(different computer) will NOT be able to even see this same logged on router as a selection to log in again.
I hope you can understand my question.
Thanks alot people!
One solution could be:
create a temp file called lock.txt.
The file will be created only after a successful login. The file will be deleted after logout.
Before login you check if the file exists and if it does the script stops.
Note:
if for some reason the temp file cannot be deleted. It is a good idea before login to check for last modification time if it is more than 24hours delete the file.
create a temp file called lock.txt.
The file will be created only after a successful login. The file will be deleted after logout.
Before login you check if the file exists and if it does the script stops.
Note:
if for some reason the temp file cannot be deleted. It is a good idea before login to check for last modification time if it is more than 24hours delete the file.
Hi,
I tried with the lock.txt. It worked pretty well.
But do you know the coding to check if a file exist or not? I am very new to PHP. Thanks!
Dav
I tried with the lock.txt. It worked pretty well.
But do you know the coding to check if a file exist or not? I am very new to PHP. Thanks!
Dav
•
•
•
•
One solution could be:
create a temp file called lock.txt.
The file will be created only after a successful login. The file will be deleted after logout.
Before login you check if the file exists and if it does the script stops.
Note:
if for some reason the temp file cannot be deleted. It is a good idea before login to check for last modification time if it is more than 24hours delete the file.
use file_exists function
php Syntax (Toggle Plain Text)
$filename = '/path/to/foo.txt'; if (file_exists($filename)) { echo "The file $filename exists"; } else { echo "The file $filename does not exist"; }
PHP,Javascript and AJAX tutorials.
I am currently accepting CodeIgniter,JQuery,WordPress ,PSD->XHTML jobs.Contact Me.
I am currently accepting CodeIgniter,JQuery,WordPress ,PSD->XHTML jobs.Contact Me.
Oh Hi,
Sorry. I done that detection of existing file already. Thanks,
Sorry. I done that detection of existing file already. Thanks,
•
•
•
•
One solution could be:
create a temp file called lock.txt.
The file will be created only after a successful login. The file will be deleted after logout.
Before login you check if the file exists and if it does the script stops.
Note:
if for some reason the temp file cannot be deleted. It is a good idea before login to check for last modification time if it is more than 24hours delete the file.
Hey hi!
Thanks for replying. Do you know how to pop u an alert window message in PHP?
Thanks,
Dav
Thanks for replying. Do you know how to pop u an alert window message in PHP?
Thanks,
Dav
•
•
•
•
use file_exists function
php Syntax (Toggle Plain Text)
$filename = '/path/to/foo.txt'; if (file_exists($filename)) { echo "The file $filename exists"; } else { echo "The file $filename does not exist"; }
I think that's not possible,Use javascript instead for popup boxes
PHP,Javascript and AJAX tutorials.
I am currently accepting CodeIgniter,JQuery,WordPress ,PSD->XHTML jobs.Contact Me.
I am currently accepting CodeIgniter,JQuery,WordPress ,PSD->XHTML jobs.Contact Me.
something like:
but this is not recommended..
php Syntax (Toggle Plain Text)
echo '<script type="text/javascript"> alert("hello"); </script>';
but this is not recommended..
Last edited by ryan_vietnow; Aug 7th, 2008 at 1:42 am.
PHP,Javascript and AJAX tutorials.
I am currently accepting CodeIgniter,JQuery,WordPress ,PSD->XHTML jobs.Contact Me.
I am currently accepting CodeIgniter,JQuery,WordPress ,PSD->XHTML jobs.Contact Me.
![]() |
Similar Threads
- RESELLER WEB HOSTING - $9.99/MONTH For 5GB HD & 75GB BW! CPanel, PHP, MySQL & MORE! (Web Hosting Deals)
- Online Database - PHP/ MYSQL (PHP)
- When a host says "included scripts" (Networking Hardware Configuration)
Other Threads in the PHP Forum
- Previous Thread: How do I add up all values of rows in a table???
- Next Thread: client side php scripting vs javascript
Views: 925 | Replies: 9
| Thread Tools | Search this Thread |
Tag cloud for PHP
access ajax apache array beginner box broken buttons cakephp check checkbox class cms code cookies database date directory display download dropdown drupal dynamic echo email error file files folder form forms function functions header hosting href htaccess html image images include insert ip java javascript joomla jquery limit link list login loop mail menu methods mlm mod_rewrite multiple mysql order parse password paypal php problem query radio random redirect regex remote results script search security select server session sessions shopping soap sort sorting source sql string system table unicode update upload url user validation variable video web website wordpress xml






