110mb.com Forum
News: Currently none. But refer to this news before you post an error, maybe it's already being fixed Wink
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 06, 2008, 02:51:22 AM


Login with username, password and session length


Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: What is fsockopen for?  (Read 885 times)
thuvien
Hyper-Active Member
***
Offline Offline

Posts: 233


PC Thư viện Trẻ - Website Thư viện - Thông tin học


WWW
« on: July 29, 2007, 05:11:14 AM »

What is fsockopen for? How to use it?
I am new user, I searched, but i'm not satisfied.
help me!  huh
Logged

PC THƯ VIỆN TRẺ : http://thuvientre.uni.cc | Vietnamese Student Library Website | Website Thư viện Thông tin học

http://thuvientre.uni.cc/community/?q=node/841
aldo
#3 Top Poster! :D
Official 110mb Guru
********
Offline Offline

Posts: 7587


SMF is ftw :D


WWW
« Reply #1 on: July 29, 2007, 05:14:00 AM »

With fsockopen() enabed you can use SMTP with your scripts to send out emails and what not with the email you configured it with wink Get it now? huh
Logged

Firefox = Not Standards Compliant
Windows is not bloated, users make it that way because of how much software is available. How can you bloat an OS that has little for it? (Linux)


Raman
Hyper-Active Member
***
Offline Offline

Posts: 421


Let's Rock D World Again...


WWW
« Reply #2 on: July 29, 2007, 05:34:51 AM »

Fsockopen is used to Initiates a socket connection to the resource specified by target. Means It is used to connect to the socket of the targeted server. You can use it to send emails as suggested by Mr. aldo....
But their are others uses too... It can also be used to retain information from servers that are allowed to share... e.g. Retrieving Information from Whois Servers....
Logged

King Zones Smiley
Earn Revenue from your website just for putting some banners: Sites and their Proofs
JETC
Hyper-Active Member
***
Offline Offline

Posts: 397


WWW
« Reply #3 on: July 29, 2007, 05:39:31 AM »

Frankly, if you don't know what fsockopen is, most likely means you won't be needing it in the first place >_> I'm kidding but yeah, don't just limit yourself searching this forum. Try google. It's a big world out there wink
Logged

thuvien
Hyper-Active Member
***
Offline Offline

Posts: 233


PC Thư viện Trẻ - Website Thư viện - Thông tin học


WWW
« Reply #4 on: July 29, 2007, 09:43:13 PM »

Yes, I know "What is fsockopen for?" now! Smiley
 Thank to Mr. aldo, Raman, JETC.
Logged

PC THƯ VIỆN TRẺ : http://thuvientre.uni.cc | Vietnamese Student Library Website | Website Thư viện Thông tin học

http://thuvientre.uni.cc/community/?q=node/841
zizou
Member
*
Offline Offline

Posts: 20


« Reply #5 on: July 29, 2007, 09:56:35 PM »

I googled it too, as I needed the support for a script I was trying to install. Smiley Thanks though for clarifying it in this topic too, made me a bit wiser, and made me start a topic less!
 afro

Logged

zizou81.110mb.com

Collecting 30 posts for the fsockopen option =-)

Macbook Pro - 2.2Ghz Core 2 Duo, 2GB ram, 8600m GT 128 mb Vram
Warlock
Tech Monkey Wizzy
Loyal 110MB Member
*******
Online Online

Posts: 2277



WWW
« Reply #6 on: July 29, 2007, 10:09:32 PM »

Quote
Collecting 30 posts for the fsockopen option =-)
.Remember, you need at least 30 USEFUL posts, so that means no 'cool website!', 'me likey likey', 'nice', or other 3 word replies.
Logged

soren121
Advanced Authority PHP Coder
Advanced Authority Member
*****
Offline Offline

Posts: 1322


All hail PHP...all hail PHP...al..OH HAI!


WWW
« Reply #7 on: July 29, 2007, 10:16:11 PM »

And if you want to use Akismet, whether it's on WordPress or through a third-party plugin, you have to get fsockopen() enabled.
Logged


Fueled by Paramore and V8
shakopeesuperseekers
Member
*
Offline Offline

Posts: 6


WWW
« Reply #8 on: October 11, 2008, 09:38:01 AM »

I'm still not sure what fsockopen can do and how. Is there anyone that can clear things up for me? Remember, talk simple.
Logged
codewhite
Hyper-Active Member
***
Online Online

Posts: 335

Violent Patient


WWW
« Reply #9 on: October 11, 2008, 09:44:22 AM »

http://www.php.net/fsockopen straight from the horses mouth.

In simple terms it is used to open a connection to another server.  It can be used to send email, get whois information, even check to see if an ftp server is available.


mod: fixed link. ~inportb
« Last Edit: October 11, 2008, 10:33:57 AM by inp o҉rtb » Logged

bind
just a man
Authority Member
****
Offline Offline

Posts: 745



« Reply #10 on: October 11, 2008, 04:06:30 PM »

I'm still not sure what fsockopen can do and how. Is there anyone that can clear things up for me? Remember, talk simple.

ok lets start from the  information you were given:

fsockopen() = "... initiates a socket connection to the specified resource ..."

now lets break down that statement.

initiates means: "starts or opens".

socket means: "one end-point of a two-way communication link between two programs running on the network".

connection means: "the successful completion of necessary arrangements so that two or more party instances can communicate".

specified resource means: the server address or ip number, and port number.

so, fsockopen() starts/opens a two-way link between two programs (one being your php code and the other being a servers address and port) running on the internet by successfully completing necessary arrangements (in this case compatible protocols) allowing the two to communicate back and forth.

it allows your script to talk to a server as a client.

this could be:
  • chat
  • email/smtp
  • http
  • data import
  • data explort
  • ftp
  • webdav
  • svn
  • xml

and alot more.

as codewhite stated, visit the link he posted to the function manual.

also, a good amount of php knowledge is extremely helpful.

Additionally, a good amount of knowledge of the protocol the server you are connecting to is using is extremely helpful, because when "talking to the server" (using fwrite), the data has to be formatted correctly for the server to understand it and allow said communication to process and progress.

There are whitepapers available online for any protocol to learn syntax, line/end-of-line format, and commands necessary for the successful communication.

Lastly, some servers require user authentication so thats needed as well for successful communication.


you want specific examples ?

1. 110mb.comservers has no inbound email for their user accounts, but many people want a contact form so their site visitors can communicate with them. Using a 3rd party email service with remote SMTP, we can use a service like Google's Gmail with fsockopen() to allow users to email the webmaster through a contact form. Additionally, a webmaster can receive automated website information through the same means for manual acount validation or if there is a website problem the script intercepts and sends to the webmaster.

2. Say you are running a webite front end for a online radio station stream. You can use the above for email contact, and you can use fsockopen() to login to the streaming server and read their XML files for current playing song and a list of played songs that updates every time a user refreshes the page or loads the page, and even have it refresh itself.

3. use a php script as an ftp client instead of a 3rd party client.

4. have an online chat service (illegal on 110mb.com)

5. importand export XML/RSS newsfeeds.

6. provide 3rd party version checking, key authentication checking, and allow for automated upgrades (in addition to using fopen).

theres really too many possibilities to mention.

fsockopen() simply allows for two-way communication to any server where you can format the data out in a way the server will understand and successfully process ... you can also request data from the server and logically process it according to its format and content.
« Last Edit: October 11, 2008, 07:58:03 PM by bind » Logged

Learn the basics, create your code, then post source code to troublshoot if you have any problems

Here is all you need to learn the basics

HTML
Javascript
CSS
PHP
MySQL



.
inp o҉rtb
The Gangsta
Global Moderator
Official 110mb Guru
*****
Online Online

Posts: 11725


experimental theologian


WWW
« Reply #11 on: October 11, 2008, 06:54:51 PM »

Thanks bind, you hit all the points pretty much.
Logged

Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

  Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC

Theme by Dilber MC | Using SEO4SMF Mod

All content on this forum (especially posts) is copyright property of 110mb & the member
who wrote the post. So if you wish to steal anyone's post on this forum, you'll wish you
were dead because our lawyers will sue your ass!