yes, you can just copy paste it, but you need to substitute the first if statement area (when its true) to perform whatever the script does.
rest, is fine. and make sure nothing else is outside the Parent IF statement.
i can give you example below again:
your secure.php (accesed from loging only):
if ($submit) {
if ($REQUEST_METHOD == 'POST') {
// Here your all the code for this
// secure script goes!
// make sure you have this exit(); here at
// the end, or else it will also execute
// the error message far below.
exit();
}
else {
// if the script is called via GET method
// following error is raised!
echo 'sorry, Illegeal request';
}
// you dont need the final ELSE statement
// for parent IF statement. because if the script
// is called directly, the following deault code
// will be executed.
echo 'Direct access to this script is not allowed';
exit();
goodluck.
Daarius...