apw Posted February 3, 2009 Share Posted February 3, 2009 Hello my question is about using #include statement. I wrote a php/sql internet based search engine. The main search is located in x.php and my main portion of my website is located in the trusty index.php now without copy and pasting the contents of x.php could i instead cal l the contents of x .php using an #include x.php? And the contents of x.php show where i have the #include for x.php? Quote Link to comment Share on other sites More sharing options...
gevans Posted February 3, 2009 Share Posted February 3, 2009 Yes, it's as simple as; include_once('x.php'); Using include once will insure that you cannot include the page twice. If x.php is in a directory, for example search it would be as follows; include_once('search/x.php'); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.