Jump to content


Photo

PHP <? include ...


  • Please log in to reply
9 replies to this topic

#1 er

er
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 October 2006 - 06:48 AM

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


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



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.awar...tiverepair.com/

#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 08 October 2006 - 07:25 AM

<?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'; ?>
that is the source code of plist.php when you click on services. see something wrong?
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 er

er
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 October 2006 - 03:59 PM

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

<?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'; ?>

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.

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 08 October 2006 - 04:03 PM

Try this see what happens.
<?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"); ?>



or

<?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"); ?>


or

<?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"); ?>


or


<?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"); ?>


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 08 October 2006 - 04:09 PM

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.

<?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"

?>

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

#6 er

er
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 October 2006 - 04:15 PM

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


#7 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 08 October 2006 - 04:17 PM

No, single or double - just a matter of habbit i guess

http://no2.php.net/m...ion.include.php

#8 er

er
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 October 2006 - 04:21 PM

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.


#9 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 08 October 2006 - 05:00 PM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#10 er

er
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 October 2006 - 05:30 PM

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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users