n8frog Posted September 6, 2010 Share Posted September 6, 2010 Hello everyone. This is my first post in these forums, I have just begun in the world of PHP. I have started my first project and I need some suggestion on how to build my admin page. First I'll start with what I envision the admin page to do. I would like to have 8-10 links at the top of the page to navigate to a page different page with admin options on each page. I would like the links on the top of the page to stay there no matter where in the admin section you are viewing. My first attempt I designed an html page with inline frames to do this. This did not seem to be a good solution because the scroll bars were buggy and not all browsers can use frames. My second idea was to create a huge php file that included the links at the top as submit buttons with different values that would update a certain value in the db that told the page to display certain html using: if(isset($_POST['submit1'] { display html } if(isset($_POST['submit2']{ display html page 2 } and so on... Although I got this to work to display each separate part of the admin section, the PHP file was a monster and difficult to follow reading the code. Any suggestions how I can do this more efficiently? Please remember I'm new to PHP so overly complicated solutions may be difficult for me to follow. Quote Link to comment https://forums.phpfreaks.com/topic/212713-new-to-php-looking-for-suggestion/ Share on other sites More sharing options...
ignace Posted September 7, 2010 Share Posted September 7, 2010 1. Create 8 files with distinct names - register.php - login.php - dashboard.php - ... 2. Write the required code in each page and include() the common sections: $headTitle = ''; $headDescription = ''; include 'html/head.php'; include 'html/menu.php'; // code include 'html/foot.php'; Quote Link to comment https://forums.phpfreaks.com/topic/212713-new-to-php-looking-for-suggestion/#findComment-1108210 Share on other sites More sharing options...
n8frog Posted September 14, 2010 Author Share Posted September 14, 2010 Thanks I was able to design something similar to what you mentioned above and it is working great. Quote Link to comment https://forums.phpfreaks.com/topic/212713-new-to-php-looking-for-suggestion/#findComment-1110951 Share on other sites More sharing options...
stevephp Posted September 23, 2010 Share Posted September 23, 2010 1) For 1st one use PHP include_once function to include header part where the navigation links will be 2) For 2end one I would suggest to use GET method instead of POST. i.e. if($_GET['action']=='part1'): display html 1 elseif($_GET['action']=='part2'): display html page 2 endif; ///////////////////////////////////////////// links will be like, <a href='page?action=part1'>part1</a> | <a href='page?action=part2'>part2</a> //////////////////////////////////////////////////////////////////////////////////////////////////////// For SEO friendly URL use .htaccess rewrite Try these. Regards, Ajax Hire Joomla Expert | Hire Drupal Expert | Hire Wordpress Expert Quote Link to comment https://forums.phpfreaks.com/topic/212713-new-to-php-looking-for-suggestion/#findComment-1114415 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.