Jump to content

Archived

This topic is now archived and is closed to further replies.

er

PHP <? include ...

Recommended Posts

I am having a little trouble with a SSI on a website on which I'm working. I have used includes for easy editing. It works great on 1 page but If I take the EXACT same code to for another page my includes no longer work. What am I missing?  Code Sample....

[code]

<?php include 'htmlstart.addin'; ?>
<p><strong>1) Content here.</strong> column long long column very long fill
<?php include 'htmlend.addin'; ?>

[/code]


I have even tried removing all the data from the includes and  putting the full code in, which of course works great. So I put 1 include back in and it fails to show on the page.

this link SHOULD show you what I'm running into...  check the source please If I'm not making any sense....

http://preview5.awardspace.com/executiverepair.com/

Share this post


Link to post
Share on other sites
[code]
<?php include 'htmlstart.addin'; ?>


<p><strong>1) Content here.</strong> column long long column very long fill
fill fill long text text column text silly very make long very fill silly make
make long make text fill very long text column silly silly very column long very
column filler fill long make filler long silly very long silly silly silly long filler
make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler
fill fill very filler text fill filler column make fill make text very make make very fill
fill long make very filler column very long very filler silly very make filler silly make make
column column </p>







<?php include 'htmlend.addin'; ?>
[/code]
that is the source code of plist.php when you click on services. see something wrong?

Share this post


Link to post
Share on other sites
Other than the fact that I sortened the filler to make the post smaller. It is exactly the same as best I can tell as what I have in the Index.php for the same site. Is there something I'm missing? Thanks for the quick response.

Here is the Index.php

[code]
<?php include 'htmlstart.addin'; ?>


<p><strong>1) Content here.</strong> column long long column very long fill
fill fill long text text column text silly very make long very fill silly make
make long make text fill very long text column silly silly very column long very
column filler fill long make filler long silly very long silly silly silly long filler
make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler
fill fill very filler text fill filler column make fill make text very make make very fill
fill long make very filler column very long very filler silly very make filler silly make make
column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column
filler make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler fill
very fill silly very make make filler text filler text make silly text text long fill fill make
text fill long text very silly long long filler filler fill silly long make column make silly
long column long make very </p>
column long long column very long fill fill fill long text text column text silly
very make long very fill silly make make long make text fill very long text column silly
silly very column long very column filler fill long make filler long silly very long silly
silly silly long filler make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler fill
fill very filler text fill filler column make fill make text very make make very fill fill long
make very filler column very long very filler silly very make filler silly make make column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column filler
make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler
fill very fill silly very make make filler text filler text make silly text text long fill
fill make text fill long text very silly long long filler filler fill silly long make column make
silly long column long make very </p>






<?php include 'htmlend.addin'; ?>
[/code]

the code you posted is the code for the Services Link.


I'm not real sure why I can't get includes to work on my other pages. I can replace all of the includes a with the code itself and only use includes for the footer. In which case the footer fails to decode. For some reason my includes are only working on the intial page.

Share this post


Link to post
Share on other sites
Try this see what happens.
[code]
<?php include ("htmlstart.addin"); ?>


<p><strong>1) Content here.</strong> column long long column very long fill
fill fill long text text column text silly very make long very fill silly make
make long make text fill very long text column silly silly very column long very
column filler fill long make filler long silly very long silly silly silly long filler
make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler
fill fill very filler text fill filler column make fill make text very make make very fill
fill long make very filler column very long very filler silly very make filler silly make make
column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column
filler make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler fill
very fill silly very make make filler text filler text make silly text text long fill fill make
text fill long text very silly long long filler filler fill silly long make column make silly
long column long make very </p>
column long long column very long fill fill fill long text text column text silly
very make long very fill silly make make long make text fill very long text column silly
silly very column long very column filler fill long make filler long silly very long silly
silly silly long filler make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler fill
fill very filler text fill filler column make fill make text very make make very fill fill long
make very filler column very long very filler silly very make filler silly make make column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column filler
make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler
fill very fill silly very make make filler text filler text make silly text text long fill
fill make text fill long text very silly long long filler filler fill silly long make column make
silly long column long make very </p>


<?php include ("htmlend.addin"); ?>

[/code]


or

[code]
<?php include_once ("htmlstart.addin"); ?>


<p><strong>1) Content here.</strong> column long long column very long fill
fill fill long text text column text silly very make long very fill silly make
make long make text fill very long text column silly silly very column long very
column filler fill long make filler long silly very long silly silly silly long filler
make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler
fill fill very filler text fill filler column make fill make text very make make very fill
fill long make very filler column very long very filler silly very make filler silly make make
column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column
filler make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler fill
very fill silly very make make filler text filler text make silly text text long fill fill make
text fill long text very silly long long filler filler fill silly long make column make silly
long column long make very </p>
column long long column very long fill fill fill long text text column text silly
very make long very fill silly make make long make text fill very long text column silly
silly very column long very column filler fill long make filler long silly very long silly
silly silly long filler make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler fill
fill very filler text fill filler column make fill make text very make make very fill fill long
make very filler column very long very filler silly very make filler silly make make column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column filler
make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler
fill very fill silly very make make filler text filler text make silly text text long fill
fill make text fill long text very silly long long filler filler fill silly long make column make
silly long column long make very </p>


<?php include_once ("htmlend.addin"); ?>

[/code]

or

[code]
<?php require ("htmlstart.addin"); ?>


<p><strong>1) Content here.</strong> column long long column very long fill
fill fill long text text column text silly very make long very fill silly make
make long make text fill very long text column silly silly very column long very
column filler fill long make filler long silly very long silly silly silly long filler
make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler
fill fill very filler text fill filler column make fill make text very make make very fill
fill long make very filler column very long very filler silly very make filler silly make make
column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column
filler make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler fill
very fill silly very make make filler text filler text make silly text text long fill fill make
text fill long text very silly long long filler filler fill silly long make column make silly
long column long make very </p>
column long long column very long fill fill fill long text text column text silly
very make long very fill silly make make long make text fill very long text column silly
silly very column long very column filler fill long make filler long silly very long silly
silly silly long filler make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler fill
fill very filler text fill filler column make fill make text very make make very fill fill long
make very filler column very long very filler silly very make filler silly make make column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column filler
make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler
fill very fill silly very make make filler text filler text make silly text text long fill
fill make text fill long text very silly long long filler filler fill silly long make column make
silly long column long make very </p>


<?php require ("htmlend.addin"); ?>

[/code]

or


[code]
<?php require_once ("htmlstart.addin"); ?>


<p><strong>1) Content here.</strong> column long long column very long fill
fill fill long text text column text silly very make long very fill silly make
make long make text fill very long text column silly silly very column long very
column filler fill long make filler long silly very long silly silly silly long filler
make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler
fill fill very filler text fill filler column make fill make text very make make very fill
fill long make very filler column very long very filler silly very make filler silly make make
column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column
filler make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler fill
very fill silly very make make filler text filler text make silly text text long fill fill make
text fill long text very silly long long filler filler fill silly long make column make silly
long column long make very </p>
column long long column very long fill fill fill long text text column text silly
very make long very fill silly make make long make text fill very long text column silly
silly very column long very column filler fill long make filler long silly very long silly
silly silly long filler make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler fill
fill very filler text fill filler column make fill make text very make make very fill fill long
make very filler column very long very filler silly very make filler silly make make column column </p>
<p>fill long make long text very make long fill column make text very silly column filler
silly text fill text filler filler filler make make make make text filler fill column filler
make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler
fill very fill silly very make make filler text filler text make silly text text long fill
fill make text fill long text very silly long long filler filler fill silly long make column make
silly long column long make very </p>


<?php require_once ("htmlend.addin"); ?>

[/code]

Share this post


Link to post
Share on other sites
If you have the files for include in your root area, you must tell the include to go one step back to get them if your include page is in another directory.

[code]
<?php

include ("htmlend.addin"); // file is in the same directory as this file

include ("../htmlend.addin"); // file is one level down from this file

include ("../inc_dir/htmlend.addin"); // file is one level down and then inside "inc_dir"

?>
[/code]

......unless i totally misunderstood your problem.....

Share this post


Link to post
Share on other sites
THANKS!!!

So if I see this correctly my whole issue was single quotes Vs double Quotes?  Mental  note made Thanks.

The Page I'm posting is test page I was running online because I thought something was wrong with my PHP on My system  ::) so the includes were in the same folder... But good Idea...

Share this post


Link to post
Share on other sites
No, single or double - just a matter of habbit i guess

http://no2.php.net/manual/fi/function.include.php

Share this post


Link to post
Share on other sites
ok so now I'm lost again...


<?php include ("htmlstart.addin"); ?>

<?php include 'htmlstart.addin'; ?> 


I see 2 differences ()' s and ""s  and what is confusing me Is I actually tried using the ()s at one point still to no avail.

Share this post


Link to post
Share on other sites
i was pointing out the fact that your php code was being displayed in your html source code.  i view sourced and copy/pasted it here, from your site.

Share this post


Link to post
Share on other sites
OK... yes I had noticed that as well... that was what was so confusing...  On the index page it was properly catching the includes, but on the second page the includes we not being sustituted.

Again Thanks to everyone for their help.

Share this post


Link to post
Share on other sites

×

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.