cURL

cURL

Post just about everything that isn't directly related to Spring here!

Moderator: Moderators

Post Reply
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

cURL

Post by Dragon45 »

Does anyone have experience with this over-featured piece of garbage? The Smug Goat home barn (http://www.smuggoat.net) has to use cURL to work with any sort of image/file loading because the host has disabled regular file stream access (dreamhost.com is the host), and I have to type another 50 lines of code per standard PHP file_get_contents function.

It's a pain in the ass and it's definitely getting in the way of setting up the damn image gallery.


WTF draemhost.

u phail.

So yeh, help would be appreciated.
User avatar
Ishach
Posts: 1670
Joined: 02 May 2006, 06:44

Post by Ishach »

run ur boy
hawkki
Posts: 222
Joined: 01 Jan 2006, 19:47

Post by hawkki »

Ishach wrote:run ur boy
Already here? nooo way!
User avatar
iamacup
Posts: 987
Joined: 26 Jun 2006, 20:43

Post by iamacup »

so fopen doesent work at all, or only on remote urls?

ive always used curl with fopen, like this

curl

Code: Select all

<?php
$handle = curl_init("http://www.example.com/");
$file = fopen("index.html", "w");

curl_setopt($handle, CURLOPT_FILE, $file);
curl_setopt($handle, CURLOPT_HEADER, 0);

curl_exec($handle);
curl_close($handle);
fclose($file);
?> 

fopen

Code: Select all

<?php

$handle = fopen("http://www.example.com/index.html", "rb");
$contents = '';

while (!feof($handle)) 
  {
    $contents .= fread($handle, 8192);
  }
fclose($handle);

?>
you could also try

Code: Select all

<?php
INI_SET("allow_url_fopen", 1);
?>
if they have crappeh admins who didnt change the httpd.conf to dissalow changes to it :P.
Post Reply

Return to “Off Topic Discussion”