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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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