Help URL file-access is disabled...

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

dsforsaken

Account Closed
Impact
11
Hi I am trying to run this script on dreamhost but it always says that url file-acess is disabled... Can somebody look a the script to see if there is another way to get it to work?
Errors that show up below:

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/.desmi/dsforsaken/videosite/admin/import.php on line 23

Warning: file_get_contents(http://www.fastfreemedia.com/export_full.php) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/.desmi/dsforsaken/videosite/admin/import.php on line 23

Warning: Invalid argument supplied for foreach() in /home/.desmi/dsforsaken/videosite/admin/import.php on line 30


This is the script below (.php):
http://shopquickly.com/import.txt

The script mentions this in it, although im pretty sure its not the problem, but if ytou ant to look:
http://shopquickly.com/xml_php5.txt
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Do you know if you are allowed to use CURL or sockets?
 
0
Close
I am allowed to use curl but i dont know how to fix this script to use thim... if someone knows how that would be awsome...
 
0
Close
class.curl.php
PHP:
<?php

class CURL {

	var $ch;
	
	function CURL () {
		$this->ch = curl_init();
		curl_setopt($this->ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
		curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
		curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($this->ch, CURLOPT_COOKIEJAR, 'cookie.txt');
		curl_setopt($this->ch, CURLOPT_COOKIEFILE, 'cookie.txt');
	}

	function request($method, $url, $vars) {
		curl_setopt($this->ch, CURLOPT_URL, $url);
		if ($method == 'POST') {
			curl_setopt($this->ch, CURLOPT_POST, 1);
			curl_setopt($this->ch, CURLOPT_POSTFIELDS, $vars);
		}
		$data = curl_exec($this->ch);
		if ($data) {
			return $data;
		} else {
			return curl_error($this->ch);
		}
	}

	function get($url) {
		return $this->request('GET', $url, 'NULL');
	}

}

$curl = &new CURL();

?>
Include that file into your current script (ex: include('class.curl.php');).

Change
$xmlParser = new XMLParser(file_get_contents($url));
to
$xmlParser = new XMLParser($curl->get($url));
 
0
Close
excellent thanks alot man so far it sorta working now, some stuff it gets just fine while other stuff gives this error:




Game Name: Stage Dancing
New Movie.

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/.desmi/dsforsaken/videosite/admin/import.php on line 54

Warning: file_get_contents(http://www.fastfreemedia.com/images/179575.jpg) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/.desmi/dsforsaken/videosite/admin/import.php on line 54

Error Reading Thumbnail.
Error writing thumbnail.Thumbnail Bytes Written: 0
Affected MySQL Rows: 1
 
0
Close
You have to change all of your file_get_contents to $curl->get
 
0
Close
what do i change all the fopen, fclose and fwrite to?
 
0
Close
It doesn't seem like you are getting an error for those. I'm really unsure of how else you could write to a file, but if it is on your own host it shouldn't be a problem.
 
0
Close
im not getting an error for those it just doesnt show the image files for the games because its either not writeing to the sql or ts not getting hte images properly, im using dreamhost and they dont allow fopen, and file_get_contents etc... btw
 
0
Close
By writing to SQL, do you mean doing mysql_query? You don't use fwrite for SQL.
To get images, you just need to do <img src="">.. there's no PHP.

It's not displaying any errors, so I don't know what to tell you.
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Quick replies: search, your most used replies, and more on every post
Quick replies are easier to find and use now. The quick reply menu has a search box. Type a few letters to find the reply you want. A...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back