Hi,
I'm new to php.I had to include common content to a lot of webpages in my website like menubar etc. and i was told i could load them dynamically from a single file using php.Can someone help me with this?
AutoC
0
Junior Poster in Training
Recommended Answers
Jump to PostYou can either use require_once to include another file, or if you want something more fancy, you could use templates (smarty for example).
Jump to PostThis works fine:
if( (require "sql.php") && 1) echo "success";
Whereas this produces a fatal error:
if( require("sql.php") && 1) echo "success";
the error:
Fatal error: require() [function.require]: Failed opening required '1' (include_path='.;C:\php5\pear') in D:\wamp\www\test\index.php on line 2
Failed opening required '1' ... huh
…
All 6 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
kadimi
10
Newbie Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
kadimi
10
Newbie Poster
nav33n
commented:
:)
+10
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
kadimi
10
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.