Help,
I have a problem in getting the html contents of my file if its directory/folder name has spaces in it.
I am using CURL to grab the html contents.. Here is a sample of the link that i am accessing to grab the html codes
http://dev24oct20part2.globalbizcloud.com/admin/content/module_templates/templates/products/all_prods/Product temP/index.html
As you can see there is a space in the directory containing my index.html and this causes the error and disallows me from grabbing the contents.
/Product temP/index.html
Here’s my code:
$template = $this->mod_template_link.$this->module_category.'/'.$this->module_unique_key.'/'.$this->module_template.'/index.html';
//value of this variable is the link above..
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $template);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);
return $this->translate_template($contents);
If There are no spaces that exist in the folder name, it works fine.
Any advice or suggestions would be greatly appreciated..
Thanks in advance.
Try filling up the space with
%20