TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-17-2011, 07:25 AM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Sep 2011
Posts: 1
Thanks: 0
georgik87 is on a distinguished road
Default 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?
georgik87 is offline  
Reply With Quote
Old 09-18-2011, 11:25 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

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.
tony is offline  
Reply With Quote
Old 09-20-2011, 08:10 PM   #3 (permalink)
The Wanderer
 
Join Date: May 2010
Posts: 19
Thanks: 1
core1024 is on a distinguished road
Default

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."
core1024 is offline  
Reply With Quote
Old 02-18-2012, 08:54 PM   #4 (permalink)
The Wanderer
 
AxelG's Avatar
 
Join Date: Feb 2012
Posts: 16
Thanks: 0
AxelG is on a distinguished road
Default

You do the request with a Get but the server answer to a Post, as tony says you should use cUrl.
AxelG is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Put in seperate $var content whats in between *&&* Peuplarchie Advanced PHP Programming 2 03-01-2011 12:49 AM
Crop Content CΛSTΞX General 3 01-14-2010 07:38 PM
Edit posted form content & if isset quesion Peuplarchie Advanced PHP Programming 1 11-09-2008 11:34 PM
My dynamic menu lesP Advanced PHP Programming 7 01-21-2008 10:28 PM
how to search the content of txt file meshi Absolute Beginners 11 11-01-2007 04:43 PM


All times are GMT. The time now is 08:46 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design