Jump to content

New to PHP looking for suggestion


n8frog

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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.