If you visit
scxml.php in your browser, does the page display the songs? If so, move
scxml.php ,
scxml-obj.php ,
config.php , and
sc-small.gif to their own folder.
After you do that, rename your index page
index.php instead of
index.html and put a file called
.htaccess (notice the dot) into the DocumentRoot directory if it’s not already there. In that file, put this:
Code: Select all
DirectoryIndex index.php index.html
Or edit the line already there so that
index.php comes before
index.html .
Then, if your home page still works, put the following at the top of it and make sure you don’t get any errors afterward:
Code: Select all
<?php
include('/path/to/scxml.php');
?>
Keep in mind that absolute paths in
include() start at root of your
file system, not your Web site.
Then take that large block of
echo statements out of
scxml.php , with a
<?php added at the beginning and a
?> at the end, and place it into
index.php at whichever point you want it to appear. If that works, you’ll have to modify the HTML within the
echo statements, because it will likely mess up the layout of your page (and you shouldn’t have two
<html> elements,
<body> elements, etc.). Remember to escape the HTML’s quotation marks like they have done.
You can echo those variables on other pages too, so long as you put the include line at the top and give the page a
.php extension.
You might want to copy your home page to a test directory and get it working there first! Also, includes are a good way to centralize things that repeat themselves in every page – sidebars, headers, footers, etc. Adding something to your sidebar would mean editing just one file instead of every page on your site.
Archived topic from Anythingforums, old topic ID:3811, old post ID:67273