chongshengdz Posted July 8, 2018 Share Posted July 8, 2018 <?php $handle = fopen('https://www.example.com/', 'r'); $content = ''; while(!feof($handle)){ $content .= fread($handle, 8080); } echo $content; fclose($handle); ?> Link to comment Share on other sites More sharing options...
bsmither Posted July 8, 2018 Share Posted July 8, 2018 Would you be willing to have the browser bring it in either as an iframe, or as an ajax request? An iframe will need to have a header issued by CubeCart be removed ("SAMEORIGIN"), and the page being requested undoubtedly is a complete web document, well suited to be in an iframe. An ajax request may need to be processed to crop away all that is not in the <body> tags. The product's description is databased and is a value of the product's details array. Once you have the description in the array held in memory, you can add more to it, or replace a {PLACEHOLDER} with $content. CubeCart also has hooks that can be used to modify details like this without making changes to the code. I think a hook is the best way to go, but be sure that your hosting provider has set PHP's ' allow_url_fopen ' to enabled. You might also think to use PHP's 'file_get_contents'. There is also CubeCart's Request class which is specifically built to get stuff from off-site. Link to comment Share on other sites More sharing options...
chongshengdz Posted July 9, 2018 Author Share Posted July 9, 2018 i am not good at coding. please help me write the code directly. Link to comment Share on other sites More sharing options...
bsmither Posted July 9, 2018 Share Posted July 9, 2018 Your details above suggest that the incoming data is static. Meaning, you will not be wanting to include any info in the request to specify a particular response. Is this correct? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.