include php file
Posted: Fri May 20, 2011 12:17 pm
I want to include php files depends on the $_GET variable.
Let's suposed that I have an index.php with a menu with:
Add -> link (index.php?page=add)
Edit -> link (index.php?page=edit)
etc....
On server I have add.php and edit.php.
The code in index.php is:
It's ok to include like that ? From security point of view.
If you have other ideas please share.
Thanks
Let's suposed that I have an index.php with a menu with:
Add -> link (index.php?page=add)
Edit -> link (index.php?page=edit)
etc....
On server I have add.php and edit.php.
The code in index.php is:
Code: Select all
<?php
if($_POST['ok']){
require($_GET['page'] . '.php');
} else {
//code from the index.php page
}
?>
If you have other ideas please share.
Thanks