nicob Posted November 24, 2008 Share Posted November 24, 2008 I'm trying to include the content of a search in a local format. But it's not working with the '?' etc in the url. Any solution for this ??? <?php include "/home/account/domains/domain.com/public_html/search.php?keyword=garden&submit=Search"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/134108-solved-how-to-include-local-page-with-in-url/ Share on other sites More sharing options...
premiso Posted November 24, 2008 Share Posted November 24, 2008 <?php $_GET['keyword'] = "garden"; $_GET['submit'] = "Search"; include "/home/account/domains/domain.com/public_html/search.php"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/134108-solved-how-to-include-local-page-with-in-url/#findComment-698080 Share on other sites More sharing options...
flyhoney Posted November 24, 2008 Share Posted November 24, 2008 You don't need to pass data into the URL of the search file because it is in the scope of your php script. So, like premiso said, just pass it variables instead. Quote Link to comment https://forums.phpfreaks.com/topic/134108-solved-how-to-include-local-page-with-in-url/#findComment-698087 Share on other sites More sharing options...
premiso Posted November 24, 2008 Share Posted November 24, 2008 Yea I guess I could have elaborated on that. But basically if you called the include like: include "http://www.yoursite.com/file/search.php?keyword=garden&submit=Search"; It would work, granted that url_include is allowed, which most servers disable for security reasons. The above way I posted is the preferred way since no processing is needed to be done and that way it does not just give you the straight html, like calling the above would. Quote Link to comment https://forums.phpfreaks.com/topic/134108-solved-how-to-include-local-page-with-in-url/#findComment-698091 Share on other sites More sharing options...
nicob Posted November 24, 2008 Author Share Posted November 24, 2008 Thanks! I was searching for this solution because they (other webmasters) told me that a local include is better than a http-include. They mean it's better for the server. Quote Link to comment https://forums.phpfreaks.com/topic/134108-solved-how-to-include-local-page-with-in-url/#findComment-698120 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.