Jump to content

Include/CMS Help


chordsoflife

Recommended Posts

Hey all-

 

I'm trying to follow this guide, and it's not working very well. The goal is to make a very basic content management system. Right now I'm trying to "Switch content with PHP variables".

 

Here is my code:

 

[pre] 

  <div class="menu" style="text-align:center;">

        <a href="index.php?page=content">Link #1</a> | <a href="">Link #2</a> | <a href="">Link #3</a>

  </div>

  <div class="body">

<?php require_once ("$page.html"); ?>

  </div>

[/pre]

 

That's in my index.php file, and my content.html file is just a bunch of text.

 

The errors I'm getting are:

Warning: require_once(.html) [function.require-once]: failed to open stream: No such file or directory on line 16 (The require_once line)

Fatal error: require_once() [function.require]: Failed opening required '.html' (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php')

 

hewlp!

Link to comment
https://forums.phpfreaks.com/topic/94045-includecms-help/
Share on other sites

I'll wrestle with getting that to work for a while. Much appreciated. I'm just starting in the world of php, so I apologize if what I'm asking is very basic.

 

The general set up is correct though, right? It should work?

 

Edit: Amazing! That didn't take much wrestling at all. PHP is amazing. I wish I knew what was happening though. I get the jist. In due time I suppose, just like everything else.

Link to comment
https://forums.phpfreaks.com/topic/94045-includecms-help/#findComment-481778
Share on other sites

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.