Click to See Complete Forum and Search --> : Page Validation
BKSwindell
04-24-2005, 07:22 PM
Can any one help me find out how to validate that page still exists before we send the user there. Or on the password scripts that have you put the password in i.e.. "1234" and then sends you to "1234.html", how do you find out if 1234.html is actually there before we send the user there. I don't want them to see the error "This page can not be found". Thanks
Brad Swindell
Swindell Productions
simpson97
04-24-2005, 09:15 PM
This should work:
<?php
if(is_file('control.html'))
{
echo 'file exists';
} else {
echo 'file does not exist';
}
?>
Bob
simpson97
04-24-2005, 09:43 PM
Disregard my post:
I thought I was in the php forum.
Bob
SpectreReturns
04-24-2005, 10:17 PM
I would suggest using a PHP password system, as JavaScript isn't very secure. However, if you have an Apache server, you could hook up an .htaccess file to display a certain page if they get a 404 error.
BKSwindell
04-25-2005, 07:40 PM
thanks, but the .htaccess will not work unless I can pass the password from the page. The way it is setup I am having the user keyin the password using the mouse to click gif images, after the user presses 5 images the script generates a number and sends it to the password script. ie. I wrote the script for the number pad and to gather the number to a varible but now I would need to pass it .htaccess login. I would be perfect if I could use .htaccess. Have any ideas how? Thanks
------------
0 0 0 0 0
------------
| 1 | 2 | 3 |
------------
| 4 | 5 | 6 |
------------
| 7 | 8 | 9 |
------------
| * | 0 | # |
------------
| ENTER |
------------