Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

layout question

Featured Replies

My site is sort of laid out in the following way;

 

Header - including menus and login etc

Main section - main part of the site content

Footer - including links etc

 

 

For different pages such as member page, profile page, should I create a whole new page with each page having the header, main and footer, or on the index.php main section should i put an 'if' statement into the coding that displays the different pages only in this section?

 

I'm not sure which I should use, I hope this makes sense to you, let me know if not.

My site is sort of laid out in the following way;

 

Header - including menus and login etc

Main section - main part of the site content

Footer - including links etc

 

 

For different pages such as member page, profile page, should I create a whole new page with each page having the header, main and footer, or on the index.php main section should i put an 'if' statement into the coding that displays the different pages only in this section?

 

I'm not sure which I should use, I hope this makes sense to you, let me know if not.

 

 

You should really only use if statements for minor differences. When the whole page etc is going to be different, stick to templates.

If it was me I would create 2 include files one for the header and one for the footer then just call them on each page.

 

so you would do something like this for each of your pages:

 

<?php

require_once($_Server["DOCUMENT_ROOT"] . /Path/To/header.inc );

?>

Content goes here

<?php

require_once($_Server["DOCUMENT_ROOT"] . /Path/To/footer.inc );

?>

 

the header.inc and footer.inc files are fine to have html or php in them.

 

 

Hope that makes sense :)

 

Ysuran

Both good answers. Do not use major bulks of content within if statements. Switch to using includes as stated above. and include the file where it would normally reside in the code.

  • Author

that's how I have it laid out at the moment.

 

<?php

 

require('header.php');

require('main.php');

require('footer.php');

 

?>

 

 

Should I have them stored as .php files or .inc files? Don't .inc files get shown as text if someone was able to access them at all?

.php files are fine. You are right .inc files will show as text.

 

I always set it up so they aren't publicly viewable but it really is a matter of choice I guess.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.