Jump to content

fsockopen


Guest

Recommended Posts

Hi, I've been trying to initiate a script on a remote server from a local server with something similar to this code:

[code]

    fsockopen('http://www.xxx.com/folder/script.php?query=string&info=241');

[/code]

I'm not looking to actually retrieve anything from the source, I just want it to run once while the current page is loading.

Is there a better way of doing this? Or am I simply not using it correctly?

Thanks in advance!
-Henrik
Link to comment
Share on other sites

Why are you only opening a socket to a different web page and not doing anything with it?

[quote]is there a better way of doing this?[/quote]

Yes, use fopen, file, file_get_contents, etc.

[quote]Or am I simply not using it correctly?[/quote]

Yes, and no.  http://www.php.net/fsockopen.  Specifically the variable that is passed to the function that returns error messages.
Link to comment
Share on other sites

Hmm, then more accurately, how would I POST some variables from the local server onto the remote using fsockopen? I can't seem to find a way to do so that'll work on all webservers.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.