Hello! I moved last night to another web host and they do not allow php include I used, like this: 1 - my index.php was like this: <?PHP include ("http://www.sitename.com/product_list.php?affiliate_id=1"); ?> Code (markup): 2 - I had pages like: cheap-medicine.php where all code was like this: <?PHP include ("http://www.site.com/search.php?search=medicine&searchb=Search"); ?> Code (markup): Can someone, please, help me to find alternative for those two problems? Thanks!
Hello, I'm not a php whiz yet, but here are the reasons that pop up to my mind: 1) Passing an url into include() may return an error because what you actually want to include is a file (source code), that is include('search.php?etc ...) 2) With respect to the above, I guess the $_GET variables won't get through as this method is more like a http protocol but what you want to refer to here is a file. 3) Why not try to first define two variables $search and $searchb (containing the appropriate inputs) and *then* call the include('search.php') ? But then again im a php newbie so ...
Yes, I can But php ini says allow_url_include Off Off I presume that is reason why I cant use "external" - http include.
function get_content($url) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_HEADER, 0); ob_start(); curl_exec ($ch); curl_close ($ch); $string = ob_get_contents(); ob_end_clean(); return $string; } $content = get_content ("http://yoursite.com/wordpress/?page_id=3"); echo ($content); Code (markup): WORKING!