Jump to content

cURL and what it can do for me.


boo_lolly

Recommended Posts

i was wondering if curl can be used to fetch the source code in the form of a string from a remote page. and if so, how do i use it? the reason why i'm asking is because i'm working on a site for a client that rents out a beachhouse. they are using a web application called jac built with cakephp to manage their booked dates and whatnot. i want to put a teaser calendar on their website that shows the current month calendar, with  the available and unavailable dates. it doesn't look like i can do this without inserting an iframe, and then i run into the never-ending browser support issue, which is what i'm trying to avoid. so i figured to fetch the html and modify it just a little and print the html into the site. communicating with the API i think is far too much work, unless you guys have found an easier way. so I'm just looking for alternatives, not just cURL info. any help?

Link to comment
https://forums.phpfreaks.com/topic/80050-curl-and-what-it-can-do-for-me/
Share on other sites

If by "source code" you mean the html output from a php script, then the answer is yes.  You can fetch it with curl as a string and print it out, and it can be used to achieve what you would achieve with an iframe.

 

Keep in mind that any delay in fetching the calendar will affect load times for the entire page.

Here's a tutorial which has the basic curl example: http://www.higherpass.com/php/Tutorials/Using-Curl-To-Query-Remote-Servers/

 

Usually you'll want to switch header off and returntransfer on if you want to capture the response and process it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.