PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
You need to send a request! The function fsockopen() only opens the connection socket! The server does not send anything until it knows it has a pending request! Have a look at the fsockopen() to better understand this!
You need to at least send EOL -> \r?\n for any sub-standard port (udp, telnet), and a full request for http ports, or PHP will not even read into the socket!
Ok it works if I use google.com as host and port 80..
could it be my host blocks all other ports except port 80?
EDIT: just asked host they said they can't unblock the ports.. does that make sense or what? I pay for hosting and they can't do that? Is there really security risks with allowing out going connections?
Ok I am now running my own webserver.... connecting works fine.. but how is reading the data done? What did you mean by EOL -> \r?\n do I send that first?
I prefer a block everything all, allow only the minimum required policy for a production server..
Offcourse they can unblock ports, they just don't want to do it.. And if you have a good sysadmin you'll have to convince him why you need to be able to do that.. That's their job after all
No i'm trying to receive data wich will look like this 0/0/0/4/osp then i'll parse it.. If I connect via telnet it doesn't need to send anything.. the server automaticly sends data to me on a set timer.
Open up telnet and type Open 212.146.85.6 3000
and you will see what I mean make sure you wait 5 seconds.