0
我在我的網站上使用curreny代碼。用下面的:我如何在我的網站上使用fsockopen?
<?php
$contents = file_get_contents('http://www.tcmb.gov.tr/kurlar/today.html');
$contents = iconv("windows-1254" , "utf8" , $contents);
$dollar = preg_match('~ABD DOLARI\s+(.+?)\s+(.+?)\s+~i', $contents, $matches) ? array('buying' => $matches[1], 'selling' => $matches[2]) : '';
$euro = preg_match('~EURO\s+(.+?)\s+(.+?)\s+~i', $contents, $matches) ? array('buying' => $matches[1], 'selling' => $matches[2]) : '';
$gbp = preg_match('~İNGİLİZ STERLİNİ\s+(.+?)\s+(.+?)\s+~i', $contents, $matches) ? array('buying' => $matches[1], 'selling' => $matches[2]) : '';
$chf = preg_match('~İSVİÇRE FRANGI\s+(.+?)\s+(.+?)\s+~i', $contents, $matches) ? array('buying' => $matches[1], 'selling' => $matches[2]) : '';
echo '
<table class="form" style="background:#fff;width:300px;margin-left:14px;">
<tr style="border-bottom:1px solid #e4e4e4;">
..
但今天我的網站是給錯誤:
Warning: eval() (/var/www/vhosts/mysite.com/httpdocs/modules/php/php.module(80) : eval()'d code dosyasının 2 satırı) içinde file_get_contents() [function.file-get-contents]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0.
我沒問我的託管有關此問題的支持,他們說:
「不要使用fopen選項,請使用'fsockopen'「但我不知道我該怎麼做?
Plese幫我。謝謝。
我不知道我在哪裏可以在代碼的改變? – user1750573
使用'fsockopen'是**不是一個好的解決方案。改用curl。您可能還想告訴您的託管公司,只要url包含被禁用,url_fopen_wrappers就是完全安全的。 – ThiefMaster
安全妄想再次襲擊! –