cakephp probleme with pagination and file_get_contents

2012-08-08 Thread yassine yas
']['countryName']; $destinations.=$destination; } $url.=$origins.$destinations.'mode=drivinglanguage=fr-FRsensor=false'; $json = file_get_contents($url,0,null,null); $details = json_decode($json, TRUE); for ($i = 0; $i count($hotels); ++$i) { $hotels = Set::insert

Re: cakephp probleme with pagination and file_get_contents

2012-08-08 Thread lowpass
=drivinglanguage=fr-FRsensor=false'; $json = file_get_contents($url,0,null,null); $details = json_decode($json, TRUE); for ($i = 0; $i count($hotels); ++$i) { $hotels = Set::insert($hotels, $i.'.Hotel.distance',$details['rows']['0']['elements']['0']['distance']['value

Re: Broken image if shown with file_get_contents()

2008-11-02 Thread Anupom
Can you please try with the following code? function view() { Configure::write('debug', 0); header('Content-type: image/jpeg;'); echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS . 'test.jpg'); exit; } On Sun, Nov 2, 2008 at 4:36 AM, Giaco

Re: Broken image if shown with file_get_contents()

2008-11-02 Thread Giaco
, 11:10 am, Anupom [EMAIL PROTECTED] wrote: Can you please try with the following code?     function view() {         Configure::write('debug', 0);         header('Content-type: image/jpeg;');         echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS . 'test.jpg');         exit

Re: Broken image if shown with file_get_contents()

2008-11-02 Thread Giaco
[EMAIL PROTECTED] wrote: Can you please try with the following code?     function view() {         Configure::write('debug', 0);         header('Content-type: image/jpeg;');         echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS . 'test.jpg');         exit;     } On Sun

Re: Broken image if shown with file_get_contents()

2008-11-02 Thread Anupom
-type: image/jpeg;'); echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS . 'test.jpg'); exit; } On Sun, Nov 2, 2008 at 4:36 AM, Giaco [EMAIL PROTECTED] wrote: Hello, for security reasons and on the fly resizing I route all picture requests

Re: Broken image if shown with file_get_contents()

2008-11-02 Thread Bernardo Vieira
PROTECTED] wrote: Can you please try with the following code? function view() { Configure::write('debug', 0); header('Content-type: image/jpeg;'); echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS . 'test.jpg

Re: Broken image if shown with file_get_contents()

2008-11-02 Thread Samuel DeVore
.php.net/manual/en/function.ob-clean.php before echoing out the file and then exiting http://us3.php.net/manual/en/function.exit.php like Configure::write('debug', 0); ob_clear(); header('Content-type: image/jpeg;'); file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS . 'test.jpg'); exit

Broken image if shown with file_get_contents()

2008-11-01 Thread Giaco
', 0); header('Content-type: image/jpeg;'); echo file_get_contents(img/folder/test.jpg); } When I don’t send the header, I see the binary version of the image. What could this possibly be? --~--~-~--~~~---~--~~ You received this message because you

Re: file_get_contents() to get response from Cake app?

2008-06-16 Thread silverquick
return a blank page with only the words true or false on it. Testing it in the browser works each time, I always get so see the expected result: http://mysite.com/mycontroller/myremoteaction/KHBAKFNV3A/KJB909/OU9- true I need to query this URL from other PHP apps, and am using file_get_contents

Re: file_get_contents() to get response from Cake app?

2008-05-13 Thread [EMAIL PROTECTED]
I do exactly what you describe. calling one CakeApp from another using file_get_contents() and... it work perfectly. General advice: Security? have you set it to anything other than the defaults? Is the remote action login-protected? I ask since you say it works in the browser... and your

Re: file_get_contents() to get response from Cake app?

2008-05-13 Thread David Christopher Zentgraf
baffled. On 13 May 2008, at 16:14, [EMAIL PROTECTED] wrote: I do exactly what you describe. calling one CakeApp from another using file_get_contents() and... it work perfectly. General advice: Security? have you set it to anything other than the defaults? Is the remote action login-protected? I

Re: file_get_contents() to get response from Cake app?

2008-05-13 Thread [EMAIL PROTECTED]
:14, [EMAIL PROTECTED] wrote: I do exactly what you describe. calling one CakeApp from another using file_get_contents() and... it work perfectly. General advice: Security? have you set it to anything other than the defaults? Is the remote action login-protected? I ask since you say

file_get_contents() to get response from Cake app?

2008-05-12 Thread David Christopher Zentgraf
or false on it. Testing it in the browser works each time, I always get so see the expected result: http://mysite.com/mycontroller/myremoteaction/KHBAKFNV3A/KJB909/OU9 - true I need to query this URL from other PHP apps, and am using file_get_contents() to do so. On my local test system this method

Re: file_get_contents() to get response from Cake app?

2008-05-12 Thread Dr. Tarique Sani
On Tue, May 13, 2008 at 9:39 AM, David Christopher Zentgraf [EMAIL PROTECTED] wrote: I have no idea what's going on, any ideas anybody? Do I need to send something using context streams or so that browsers do but PHP/curl don't for Cake to respond to me? I am presuming that you have set

Re: file_get_contents() to get response from Cake app?

2008-05-12 Thread David Christopher Zentgraf
Okay, that's weird. Setting Debug to 1 in core.php suddenly gives me an output. Even though in my remote action I explicitly call: $this-layout = 'ajax'; Configure::write('debug', 0); Interestingly, if I set debug to 0 in core.php and try to turn it back on in my action, it doesn't work

Production Server, file_get_contents, Permission denied

2007-11-14 Thread Zaza
I am developing in cakePHP 1.1.18 on MAMP (Mac OSX), with Apache 2.2 and PHP 5.2.3. MAMP runs under my own username and the web directory is owned by me too. Everything works fine. When I transfer the code to the production server (Red Hat, Apache 2.2, PHP 5.1.6) and have the web directory owned

Re: Production Server, file_get_contents, Permission denied

2007-11-14 Thread francky06l
Are you sure about the permissions on sub-directory ? run chmod -R 777 on cache maybe On Nov 15, 12:09 am, Zaza [EMAIL PROTECTED] wrote: I am developing in cakePHP 1.1.18 on MAMP (Mac OSX), with Apache 2.2 and PHP 5.2.3. MAMP runs under my own username and the web directory is owned by me

Re: Production Server, file_get_contents, Permission denied

2007-11-14 Thread Zaza
The whole tmp and cache directory is 777. Cake can write the cached model files but then throws warnings when it tries to read them again. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to

Re: file_get_contents()

2006-07-13 Thread John Zimmerman [gmail]
I replaced the following line of codereturn file_get_contents($url);with $curl_handle = curl_init($url);curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT,10); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); $content = null;$content = curl_exec($curl_handle); curl_close($curl_handle);return

Re: file_get_contents()

2006-07-11 Thread nate
Using any file functions (file_get_contents, fopen, etc.) against an external URL is considered unsafe in general. Your best bet is to use curl instead. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Re: file_get_contents()

2006-07-11 Thread John Zimmerman [gmail]
The library that uses the file_get_contents() function on the external URL is not my code, but I can modify the library to use curl I guess and notify the author.I guess what is stumping me here is why it works correctly with a plain linear PHP script, but not in Cake. Cake causes the server

Re: file_get_contents()

2006-07-11 Thread Samuel DeVore
I have found that in some cases my php from the command line is completely different from php as interpreted in the browser.Sam DOn 7/11/06, nate [EMAIL PROTECTED] wrote:Yeah, that's really odd.The only thing that comes to mind is an errant ini_set, but it doesn't look like Cake is setting

Re: file_get_contents()

2006-07-11 Thread John Zimmerman [gmail]
I have found the issue with command line being different as well in some environments.That is usually due to the webserver either being on a different host than your shell server or your webserver is using PHP through CGI. Both of my situations are being executed by the webserver and output is in

file_get_contents()

2006-07-10 Thread John Zimmerman [gmail]
include (via vendor or require, tried both) in my Cake environment I have problems with the file_get_contents() function. This is the warning that comes upWarning: file_get_contents(): URL file-access is disabled in the server configuration And the map will not load. The file which