Jump to content

Managing Web Applications


Cobby

Recommended Posts

Hi all,

 

I have been doing procedural all my PHP life, and have just grasped the basics of OOP and Smarty (template engine). I know want to utilize these in my projects.

I have been looking at how phpBB forums work, and the way I understand it, every page is made up from 5 different pages:

-A config file

-PHP code file

-Header template

-Content template

-Footer template

 

Is this the best way to do it?

I also noticed that in some places they have used OOP, how do I integrated procedural and OOP?

 

Cheers,

Cobby

Link to comment
https://forums.phpfreaks.com/topic/66484-managing-web-applications/
Share on other sites

Another questions, when referring to another page, is there a better alternative to:

<?php
header("Location: <web address>");
?>

 

Because as you well know, you cant have started rendering html to call that function, which means:

<?php
if($page == "refer"){
   header("Location: <web address>");
}elseif($page == "page"){
  include 'header.php';
  echo "Page.";
  include 'footer.php';
}else{
  include 'header.php';
  echo "Another page.";
  include 'footer.php';
}
?>

 

Instead of having:

<?php
include 'header.php';

if($page == "refer"){
   header("Location: <web address>");
}elseif($page == "page"){
  echo "Page.";
}else{
  echo "Another page.";
}

include 'footer.php';
?>

 

Is there a way to do this?

 

Cheers,

Cobby

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.