Free Web Hosting Forum
Go Back   Free Web Hosting Forum > 000WebHost Services > Customer Assistance
Reload this Page fsockopen() - they say it's enabled - doesn't work
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
Junior Member
MultiGamer is on a distinguished road
 
Posts: 3
Join Date: Jul 2010
Unhappy fsockopen() - they say it's enabled - doesn't work - 07-08-2010, 05:16 PM

Hello!

I searched the forums and found that fsockopen() is enabled.
If it is, why it does not work at mine?

Here are my data:
Domain samp-tools.vacau.com
Username a5010206
Password i_wont_give_it_to_you
Disk Usage 0 / 1500.0 MB
Bandwidth 100000 MB (100GB)
Home Root /home/a5010206
Server Name server43.000webhost.com
IP Address 64.191.119.245
Apache ver. 2.2.13 (Unix)
PHP version 5.2.*
MySQL ver. 5.0.81-community
Activated On 2010-07-08 11:09
Status Active

Can someone tell me why it does not work?
I need it urgently...

P.S.: The script and the server are OK. I tested the script on localhost (my pc) and a friend's account (at another host) and it works fine...
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
Bad Karma[CORE]'s Avatar
333 - only half evil
Bad Karma[CORE] is on a distinguished road
 
Posts: 6,495
Join Date: May 2008
Default 07-08-2010, 06:31 PM

fsockopen works fine on the server i am on.
So you can test your server, respectively the server you are on i attached a little script that will check fsockopen as well as mail. Just edit the email address in the script.

Download the file
Open it in a text editor and change the email to yours
Upload the file to your server
Open the file in your browser and wait for the results
Attached Files
File Type: zip fsock_test.zip (1.0 KB, 43 views)
Reply With Quote
(#3 (permalink))
Old
Junior Member
MultiGamer is on a distinguished road
 
Posts: 3
Join Date: Jul 2010
Default 07-09-2010, 02:54 PM

I don't understand what's happening here, it shows that it's OK.

BTW: are UDP sockets also enabled, because I use them...
Reply With Quote
(#4 (permalink))
Old
Bad Karma[CORE]'s Avatar
333 - only half evil
Bad Karma[CORE] is on a distinguished road
 
Posts: 6,495
Join Date: May 2008
Default 07-09-2010, 03:06 PM

You could check for UDP being reachable by using something simple along the lines of this
PHP Code:
<?php
$fp 
fsockopen("udp://127.0.0.1"13$errno$errstr);
if (!
$fp) {
    echo 
"ERROR: $errno - $errstr<br />\n";
} else {
    
fwrite($fp"\n");
    echo 
fread($fp26);
    
fclose($fp);
}
?>
Just replace the IP/URL and the port
Reply With Quote
(#5 (permalink))
Old
Junior Member
MultiGamer is on a distinguished road
 
Posts: 3
Join Date: Jul 2010
Default 07-09-2010, 06:43 PM

Quote:
Originally Posted by Bad Karma[CORE] View Post
You could check for UDP being reachable by using something simple along the lines of this
PHP Code:
<?php
$fp 
fsockopen("udp://127.0.0.1"13$errno$errstr);
if (!
$fp) {
    echo 
"ERROR: $errno - $errstr<br />\n";
} else {
    
fwrite($fp"\n");
    echo 
fread($fp26);
    
fclose($fp);
}
?>
Just replace the IP/URL and the port
It show nothing. All I get is a blank page. No error, no responce...
Reply With Quote
(#6 (permalink))
Old
Junior Member
HAWK0987654321 is on a distinguished road
 
Posts: 4
Join Date: Apr 2011
Default 04-11-2011, 07:20 PM

I have also tried sending udp packets. I found that my packets were not being written for whatever reason.

PHP Code:
<?php
    $fp 
fsockopen("udp://".$_GET['IP'], $_GET['PORT'], $errno$errstr);
    if (!
$fp){
        echo 
"ERROR: $errno - $errstr<br />\n";
    }
    else{
        echo 
"IP: ".$_GET['IP']."<br />";
        echo 
"Port: ".$_GET['PORT']."<br />";
        echo 
"Data to Write: \\".$_GET['d']."\\<br />";
        echo 
"Bytes written to socket: ".fwrite($fp"\\".$_GET['d']."\\")."<br />";
        
stream_set_timeout($fp2);
        
$res fread($fp2000);
        
$info stream_get_meta_data($fp);
        
fclose($fp);
        if (
$info['timed_out']){
            echo 
'Connection timed out!';
        }
        else{
            echo 
"Returned data: ".$res;
        }
    }
?>
yourFileNameHere.php?IP=theIPgoesHere&PORT=thePort Here&d=theDataToSend

fwrite returns the amount of bytes written. Oh, and the above script is sending data with a \ on either side of the data. That is app specific, just remove those if not applicable.

Last edited by HAWK0987654321; 04-11-2011 at 07:23 PM.
Reply With Quote
(#7 (permalink))
Old
chanh's Avatar
Administrator
chanh is on a distinguished road
 
Posts: 2,012
Join Date: Dec 2008
Default 04-11-2011, 07:36 PM

just a reminder gaming script on 000webhost is not allowed.
Reply With Quote
(#8 (permalink))
Old
Junior Member
HAWK0987654321 is on a distinguished road
 
Posts: 4
Join Date: Apr 2011
Default 04-11-2011, 08:38 PM

I almost forgot about this, but wanted to ask, what is considered "gaming script"?

(sorry, this is kinda another topic)
Reply With Quote
(#9 (permalink))
Old
lobrc's Avatar
Administrator
lobrc will become famous soon enough
 
Posts: 5,111
Join Date: Jan 2010
Default 04-11-2011, 10:17 PM

When we say gaming scripts we mean scripts that are hosted on out servers which are purely for pleasure/enjoyment. The reason we don't allow these is because they use a lot of server resources.


If you're having problems with your account, please submit a ticket from your members area.

--

Free Script Installation Service
Reply With Quote
(#10 (permalink))
Old
Junior Member
HAWK0987654321 is on a distinguished road
 
Posts: 4
Join Date: Apr 2011
Default 04-11-2011, 10:22 PM

So querying a game server just for stats is ok?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com