Could use some php include help here...

Agenator

Member
Messages
341
Reaction score
0
Points
16
So I'm trying to use thirdchord for a band's website that I'm working on. The script works great but I cant seem to get the script to embed the track grid (third chord generates a unique track grid for each album which can be embedded in an html page). The embed uses and include statement as follows:
PHP:
<?php 
$ID=1;
include("/home/mpband/public_html/thirdchord_0_8_4/trackGrid.php");
?>
When i go to insert that into my download page (which is just an html file and an external style sheet). It doesn't show up. For that matter, if I try and echo something with php it doesn't show up either. So my question is, how do I get the php code to execute?
 

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
Use relative paths, eg. If your file is under public_html:
PHP:
<?php 
$ID=1;
include("thirdchord_0_8_4/trackGrid.php");
?>
 

Agenator

Member
Messages
341
Reaction score
0
Points
16
tried and failed, It still doesn't show up (like I said, no php code will execute, even a simple echo command). Could it be that I didn't specify that php code would be included (other than the <?php tag) or could it be that i didn't specify a doc type?
 

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
Well, the most obvious question would be is it a .php file? (just checking)
 
Last edited:

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
(third chord generates a unique track grid for each album which can be embedded in an html page)

to execute any PHP function it has to be *.php, to tell the server to start looking for the <?php tags and execute what's inside of them;otherwise it will just look at it as if it is a regular html file and not execute php
 

Agenator

Member
Messages
341
Reaction score
0
Points
16
to execute any PHP function it has to be *.php, to tell the server to start looking for the <?php tags and execute what's inside of them;otherwise it will just look at it as if it is a regular html file and not execute php

And I suddenly realize how little i know about php
Thanks alot to the both of you!
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
And I suddenly realize how little i know about php
Thanks alot to the both of you!
its ok, when I first started I thought like that too that I could execute php in html; but I quickly learned that none of my scripts were working
 

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
Hehe, we all run it to stupid mistakes. Im sure some of you seen my first threads XD
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
you can, in theory parse PHP in an html file, if you tell the server to do so via the .htaccess

but, yeah. thats simpler. :D
 
Top