Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

What is the difference between include and require?


devink

Recommended Posts

I want to create some HTML files to include on my site, for information pages. I would like to do it by stripping an Osc page to the bare bones, and then "include" my external HTML file in the empty space in the middle.

 

I have my Osc template, I simply used shipping.php and removed the little that was in there.

 

The question is, what line of code do I use to "include" my HTML? I am a competent HTML coder, but PHP is new to me.

 

Thanks in advance.

Many Thanks,

 

Steve

Link to comment
Share on other sites

As far as i know they are pretty much the same function. Out of preference i use require(), however thats just a coding habit i have, and not really through any conscious thought.

 

Found this statement on the web briefly, which might help:

 

"From the PHP documentation, it's more efficient (and predictable) to use the "Require" function to store your page index. <br> <br> "include" is best used with control structures, eg., when using loops or if statements to decide which code to include. "

Regards, Jay.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...