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? Link to comment https://forums.phpfreaks.com/topic/143604-using-and-understanding-the-include/ 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'); Link to comment https://forums.phpfreaks.com/topic/143604-using-and-understanding-the-include/#findComment-753465 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.