How to add a new page

Million Dollar Script doesn’t have a built in way to add new pages. However this isn’t very hard to do with a little work.

First you must create a new file in the root path (same folder as the MDS config.php) with the following content:

<?php
// set the root path
define( "MDSROOT", dirname( __FILE__ ) );

// include the config file
include_once( MDSROOT . "/config.php" );

// include the header
include_once( MDSROOT . "/html/header.php" );

?>
YOUR CONTENT (can include HTML)
<?php
include_once( MDSROOT . "/html/footer.php" );
?>

You can add your stuff where it says YOUR CONTENT (can include HTML) and as suggested your code can include HTML. If you don’t know HTML you search for a visual HTML editor, there are plenty of free ones available online. Be sure not to edit anything before or after that line but you can add as many lines in between the ?> and <?php lines as you want.

For example:

<?php
// set the root path
define( "MDSROOT", dirname( __FILE__ ) );

// include the config file
include_once( MDSROOT . "/config.php" );

// include the header
include_once( MDSROOT . "/html/header.php" );

?>

<h1>Hello World!</h1>
<p>This is my page content.</p>

<?php
include_once( MDSROOT . "/html/footer.php" );
?>

Next you must create a menu item to link to this page. For this you must edit the file located at html/header.php. Find the section near the bottom that looks like this:

<!-- menu links -->
<div class="menu_outer">
  <div class="menu_bar">
    <ul class="menu">
      <li><a href='index.php'>Home</a></li>
      <li><a href='users/'>Buy Pixels</a></li>
      <li><a href='list.php'>Ads List</a></li>
    </ul>
    <div class="clear"></div>
  </div>
</div>

What you want to do is copy and paste one of the lines so it looks like this:

<!-- menu links -->
<div class="menu_outer">
  <div class="menu_bar">
    <ul class="menu">
      <li><a href='index.php'>Home</a></li>
      <li><a href='users/'>Buy Pixels</a></li>
      <li><a href='list.php'>Ads List</a></li>
      <li><a href='hello.php'>Hello</a></li>
    </ul>
    <div class="clear"></div>
  </div>
</div>

Notice I’ve changed the link to the new file I created above and adjusted the menu text to Hello.

One last thing you may want to do is remove the line in the main.css file for aligning the page in the center. So open up the main.css file and near the bottom change:

.container {
  width:1001px;
  margin:0 auto;
  text-align:center;
}

to:

.container {
  width:1001px;
  margin:0 auto;
}

Once you save your file it should appear on your site once you refresh your page.