Welcome Guest, Not a member yet? Register   Sign In
File Get Contents Question
#1

[eluser]mrwilson1[/eluser]
Good evening. I am trying to get out to Stop forum spam to get some files information, is; is my visitor in the forum spam database. If the answer is yes then I can block them.

I get the following errors when I use this file. is there a work around or a setting that i can change to allow this file to do its thing?

Code:
A PHP Error was encountered

Severity: Warning

Message: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration

Filename: main/spambot.php

Line Number: 13
A PHP Error was encountered

Severity: Warning

Message: file_get_contents(http://www.stopforumspam.com/api?ip=69.138.147.251) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found

Filename: main/spambot.php

Line Number: 13

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home//public_html/ci/system/application/views/main/spambot.php:14 Stack trace: #0 /home//public_html/ci/system/application/views/main/spambot.php(14): SimpleXMLElement->__construct('') #1 /home//public_html/ci/system/application/views/main/spambot.php(56): checkSpam() #2 /home//public_html/ci/system/application/views/main/header.php(2): include('/home//...') #3 /home//public_html/ci/system/libraries/Loader.php(677): include('/home/shivabe1/...') #4 /home/public_html/ci/system/libraries/Loader.php(307): CI_Loader->_ci_load('69.138.147.251') #5 /home/shivabe1/public_html/ci/system/application/views/template1.php(3): CI_Loader->view(Array) #6 /home//public_html/ci/system/libraries/Loader.php(677): include('/home//...') #7 /home//public_html/ci/system/libraries/Loader.php(307): CI_Loader->_ci_load('main/header') #8 /home//public_html/ci/system in /home//public_html/ci/system/application/views/main/spambot.php on line 14

I know the file works fine as I use it on other sites.

Thanks.
#2

[eluser]BrianDHall[/eluser]
Quote:Message: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration

There is your problem. You are directing file_get_contents to a URL, and URL file-access is an option that PHP can enable or disable in the php.ini file with allow_url_fopen and allow_url_include directives.

By default these directives cannot be overridden with a call to ini_set(). You will need to either use a function such as CURL to get the file contents and manipulate the file locally, or you need to have your PHP.ini file changed to "allow_url_fopen=1".
#3

[eluser]mrwilson1[/eluser]
Ok, Understood.

thank you very much, appreciate it!
#4

[eluser]mrwilson1[/eluser]
briandhall, thanks again for your expertise, my hosting co. changed it and everything works fine.
#5

[eluser]BrianDHall[/eluser]
[quote author="mrwilson1" date="1254860495"]briandhall, thanks again for your expertise, my hosting co. changed it and everything works fine.[/quote]

You are very welcome, and glad to hear you were able to fix your problem without much fuss.




Theme © iAndrew 2016 - Forum software by © MyBB