This is a server configuration issue
You need to edit your php.ini file
from
allow_url_fopen = Off
allow_url_fopen = On
speak to your hosting providers how may be able to do that for you
Hi,
I am reciving an error from my PHP file, the error is :
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /www/zxq.net/x/c/l/xclusivegigs/htdocs/XclusiveGigs.php on line 14
The php file is:
Can someone please ell me how i can fix this?PHP Code:<?php
//connects to our database
require_once('db_connect.inc');
db_connect();
//create instance of XMLReader
$xmlReader = new XMLReader();
//define the filename we wish to write to and the url we wish to download from
$filename = "Ticketmaster_UK_Events.xml";
$url = "http://feeds.perfb.com/index.php/download?OEMAIL=adityakishor@hotmail.com&PX=1c53a6624ce5b96bcd7bf7c7971ffcfa&DISPLAYFORMAT=XMLGZIP&REVERSEMAPXML=yes&PRODUCTDB_ID=306";
//this creates the file "feed_download".xml and takes he contents from the URL and stores them into the file
file_put_contents(‘Ticketmaster_UK_Events.xml’, file_get_contents('http://feeds.perfb.com/index.php/download?OEMAIL=adityakishor@hotmail.com&PX=1c53a6 624ce5b96bcd7bf7c7971ffcfa&DISPLAYFORMAT=XMLGZIP&R EVERSEMAPXML=yes&PRODUCTDB_ID=306'));
//read in xml file
$xmlReader->open(‘Ticketmaster_UK_Events.xml’);
//loop to read in data
while ($xmlReader->read())
{
switch ($xmlReader->name)
{
//this finds the parent node for each instnc of a product
case 'product':
//this initialises the xml parser
$dom = new DOMDocument();
$domNode = $xmlReader->expand();
$element = $dom->appendChild($domNode);
$domString = utf8_encode($dom->saveXML($element));
$product = new SimpleXMLElement($domString);
//read in data
$product_code = $product->product_code;
$product_name = $product->product_name;
$leval1 = $product->level1;
$description = $product->description;
$short_deeplink = $product->buyat_short_deeplink_url;
$oldstyle_deeplink = $product->old_style_deeplink_url;
$image_url = $product->image_url;
$currency = $product->currency;
$availability = $product->availability;
$apr_full = $product->APR_full;
$apr = $product->APR;
$balancetransfer_free = $product->BT_Free;
$interest_free_period = $product->interest_free_period;
$credit_limit = $product->credit_limit;
$benefits = $product->benefits;
$company_text = $product->company_text;
//insert query
if(strlen($product_code) > 0) //product_id is chosen because there must be an id for each product
{
$query = mysql_query("REPLACE INTO seatwave
(product_code, product_name, level1, description, short_deeplink, oldstyle_deeplink, image_url, currency,
availability, apr_full, apr, balancetransfer_free, interest_free_period, credit_limit, benefits, company_text)
VALUES ('$product_code', '$product_name', '$level1', '$description', $short_deeplink', '$oldstyle_deeplink',
'$image_url', '$currency',
'$availability', $apr_full', '$apr', '$balancetransfer_free', '$interest_free_period', '$credit_limit', '$benefits',
'$company_text')");
echo $product_name . "has been inserted </br>";
}
break;
}
}
?>
Thanks
This is a server configuration issue
You need to edit your php.ini file
from
allow_url_fopen = Off
allow_url_fopen = On
speak to your hosting providers how may be able to do that for you
I am using a free account on zymic.com, have emailed them asking them if they cn do that, will wait for reply
While that is happening, do you know any free hosting website which have this changeable and have mysql and php?
Thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks