Jump to content

Recommended Posts

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. :)

Link to comment
https://forums.phpfreaks.com/topic/212713-new-to-php-looking-for-suggestion/
Share on other sites

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';

  • 2 weeks later...

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 ExpertHire Wordpress Expert

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.