TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   Get content from dynamic url (http://www.talkphp.com/advanced-php-programming/5984-get-content-dynamic-url.html)

georgik87 09-17-2011 07:25 AM

Get content from dynamic url
 
Hello.
I'm trying to get the content of a website, and store it in a variable.
I have tryed this code:

PHP Code:

$c file_get_contents('http://www.booking.com/hotel/ro/ramada-plaza-bucharest.php?checkin=2011-09-19;checkout=2011-09-20');
echo 
$c

If i enter the url directly in browser it shows me the rooms available for the checkin that i've put in the link.
But if i run the php script on server the checkin and checkout take no effect, so the website ask me for the checkin and checkout date. It is possible to get the website content with checkin and checkout that i've wrote in the url?

tony 09-18-2011 11:25 PM

it seems more like you have to submit the form for searching checkin times and get the results from that. For that file_get_contents falls a little short (maybe not with stream context, but I haven't use those) I would recommend using curl to submit a form with the filled parameters and get the webpage result for that.

core1024 09-20-2011 08:10 PM

I got 404 on this URL ie i got this message "Page not found
We are sorry, we could not find the page that you were looking for."

AxelG 02-18-2012 08:54 PM

You do the request with a Get but the server answer to a Post, as tony says you should use cUrl.


All times are GMT. The time now is 11:55 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0