Posting With Fsockopen ?
I am trying post article using fsockopen. Even though i can connect to the server, i am keep getting this error message when ever i try to post something.
Warning: Supplied argument is not a valid File-Handle resource in
/user/php/send.php on line 19
View Complete Forum Thread with Replies
Related Forum Messages:
Problem Posting Vars With Fsockopen
I am trying to post some variables using a http socket connection. I get a successful "200" response, and can echo the response page. But the variable (key=1234) does not seem to be successfully posted. The page I am opening contains var_dump($_REQUEST) but it seems to be empty.
View Replies !
Warning: Fsockopen() [function.fsockopen]: SSL: Connection Reset By Peer In
I keep gettin this error when i submit on the form hosts say its all ok for them but isnt for me Warning: fsockopen() [function.fsockopen]: SSL: Connection reset by peer in /home/jaynbhav/public_html/msn/msnpauth.php on line 67 Warning: fsockopen() [function.fsockopen]: php_stream_sock_ssl_activate_with_method: SSL handshake/connection failed in /home/jaynbhav/public_html/msn/msnpauth.php on line 67 Warning: fsockopen() [function.fsockopen]: failed to activate SSL mode 1 in /home/jaynbhav/public_html/msn/msnpauth.php on line 67
View Replies !
Using Fsockopen()
While using fsockopen(), to check a URL using: $fp = fsockopen("$url", 80, $errno, $errstr, 30); if (!$fp) { echo "<br>The Link (URL) could ot be validated<br> <b>You entered: $url</b><p> <a href="../auth/user_edit.php">Please try again</a><p>"; exit(); } else { // then it was successful! fclose($fp); // and carry on } It does the job as expected My message is displayed but also the following warning: Warning: fsockopen() [function.fsockopen]: unable to connect to http://www.asdfghjkl.com:80 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in C:wampwwwaaaaaurllinkssubmit_url.php on line 106 The rest (my message) is fine and required:
View Replies !
Fsockopen()
All variables are defined and the 'else{ $sendbody = ... blah, blah, blah,.... mail(vars) } works. It only has problems when the mail server is a remote host or I am attempting to connect via IP rather than use the mail command. If the first section is correct I am connecting, just not finishing session ($text91 says unable to connect, blah, blah, blah, etc...). Code:
View Replies !
IIS Fsockopen
My code here accesses an IIS server and returns HTTP/1.1 400 Bad Request Server: Microsoft-IIS/5.0 Date: Fri, 16 Apr 2004 10:36:56 GMT Content-Type: text/html Content-Length: 87 The parameter is incorrect. what am i doing wrong? does anyone know what a valid http post header for IIS would look like? <?php $fp = fsockopen("www.suedtirol.info", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />"; } else { $out = "HEAD /XmlApi/Demo/SeekEngine.Get http/1.0"; $out .= "Host: www.suedtirol.info"; $out .= "Connection: Close"; fputs($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); } //php fsockopen IIS error ?>
View Replies !
Fsockopen And SSL
I'm trying to open a socket to a web page that uses SSL. If I specify port 80 (obviously wrong, I know), I get an error stating that the page uses SSL, and that I should use https:// to specify the address. Of course, since I'm trying to open the page using fsockopen this doesn't help. If I specify port 443 the script just times out. When I try the same script on a non-SSL page using port 80 it works great, so I know the basic script is ok. Is there any way to specify that you want to connect securely in the HTTP request header? I've been looking for info on this everywhere and haven't had any luck.
View Replies !
Fsockopen() Help
I'm trying to open, read and extract information from a website (maximum and minimum temps from http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV10450.txt )... Could anyone give me some direction in how to do this? Below is the code I have written but i keep get given an 'invalid stream resource' error <?php $page = "www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV10450.txt"; $time_limit = 60; $file = fsockopen($page, $errno, $error, $time_limit); if(!fp){ echo("Connection failure"); } else { fputs($file, "GET / HTTP/1.0 "); while (!feof($file)){ $data[] = fgets($file, 1000); } fclose($file); } ?>
View Replies !
PHP + Hi5 + Fsockopen
I need some ideias on this problem, it looks like this: * I need to have a script that logs in hi5 with a given username/password [This one is already working] * Then uploads pictures to the given username profile [??] My doubt is, how can I keep the 2nd part of the script logged in so I can upload my picture? I need to do this with sockets, not using curl functions.
View Replies !
@fsockopen
here about time out settings. @fsockopen ("IP", PORT, $errno, $errstr, .2) Is the .2 a timeout length? If so what are the limits on the value? ex: .1 - .9 .
View Replies !
Should I Use Fsockopen Or Something Else?
Currently I am making a "tool" :) that will grab some websites source code and will search for a specified text (e.g. javascript codes) in it. I am using fsockopen function for connection to a website and it works great if the websites location is normal. E.g. if the website starts at www.example.com then fsockopen works fine, but if the website uses auto-redirect(via Location header field) to www.example.com/en/ or www.example.com/login.php then it doesn work. It only shows the redirect pages headers. Maybe you have some better ideas how to grab websites source code? I've heard that fopen is not working remotely with most servers..
View Replies !
Fsockopen
is there any way to test if fsockopen command is available to be used on my hosting server? my web hosts advise me that it is up and running (I had to pay extra to get a dedicated server to get the function) but im not too sure as I cannot connect to grab shoutcast stats using the function with a script i already have, which is my goal (I run a internet radio site), however if i upload exactly the same script to another server i use for another site to test it, it works without problem.
View Replies !
Fsockopen Via Ssl
I'm having issues attempting to create an ssl connection using fsockopen. my code contains the following line . fsockopen("ssl://siteaddr",993,$errno,$errmsg,20); error message reported: Error: unable to connect to ssl://server.name.tld:993 When i tail the logs on the remote machine i see no connection attempts from the web server. it appears to die before attempting to make a connection attempt. Code:
View Replies !
Fsockopen Won't Timeout...
Hi, i am using the following code to check a few ports on a few servers to see if they are up or down. But they never seem to time out, can someone tell me what to do pls?
View Replies !
Parse_url() And Fsockopen()
When i parse a url and use it in fsockopen() to retrive a file header sometimes i get an error that just keeps printing itself down the page until i hit "STOP" on my browser. It only happens when the url is something like: http://sub.domain.thing.com/dir/folder/file/name.ext with many subdomains and folders....How would i stop the error from occuring and possibly fix the problem?
View Replies !
Fsockopen Problem
Hi, I am trying to complete a post using fsockopen but I'm getting the following error: "Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? I am running php 5.1.4 with apache 2 on fedora core 4. When I configured php I did it like this: ../configure --with-apxs2=/usr/sbin/apxs --with-mysql All I'm trying to achieve is to get a response from the neteller test server, the response will be an error as the numbers I'm sending it are garbage, but I'm not bothered about that, I just want to be able to send the request and get the response back. I've searched google for a while but can't figure out why my code isn't working, I know there were problems with windows platforms with php4 but obviously, that is not an issue here... Thanks in advance, my code is below...
View Replies !
Odd Fsockopen Behavior
Any IP address I try to open with fsockopen on a particular server seems to use another IP address instead. eg. I open a socket connection to 192.168.1.1 but the remote_addr that the other server sees is 192.168.1.255. It's as if, like I said, the IP address I supply to fsockopen is being replaced with another one. Anyway, this is breaking a script of mine. I don't think I can really do a lot in PHP to fix this but is there perhaps some way that I can detect it? Is there some command line parameter that I can pass to passthru or something that'll tell me whether or not such a thing is happening? Also, how is this even being done? Could a firewall do this? If so, I'm still not even sure how it'd be done...
View Replies !
Local Fsockopen()
I am tring to develop a site that conects via sockets. I am doing the development on a localhost Apache server here's a small code example:- <?php $host="127.0.0.1"; $socket=fsockopen($host,80,$errno,$errstr,50); if(!$socket){echo "NO CONNECTION".$errno.$strerror;} else { fputs ($socket, "GET/apache/htdocs/phpinfo.php HTTP/1.1"); $info='' while (!feof($socket)) { $info.=fgets($socket,1024);} fclose ($socket); echo $info; I'm having a problem with the fputs() line. After the GET/ sataement I am trying to direct he socket to a file, so I will be able to read/write but the fputs() doesn't seem to accept any path I put into it. The socket works ok because If I leave out the path I am sent o the apache intro page on my localhost.
View Replies !
Request Fsockopen
I'm having a problem with fsockopen function, I'm programming with php 4.3 and need to do an HTTP POST over secure socket, ssl, here's my code: $context = stream_context_create(); $result = stream_context_set_option($context, 'ssl', 'local_cert', "/certificate/cert.pem"); $result = stream_context_set_option($context, 'ssl', 'passphrase', "passphrase"); $sock = fsockopen("ssl://myhost", 443 , $errno, $errstr, 30, $context); if (!$sock) die("$errstr ($errno) "); I get this error when trying to run this code: Warning: fsockopen(): Unable to set local cert chain file `/certificate/cert.pem' Check that your cafile/capath settings include details of your certificate and its issuer in /path/to/file.php on line xxx Dunno what to do, I thought there's something wrong in my certificate but couldn't find any real explanation on google or php site,
View Replies !
GET Request W/fsockopen()
The following function retreives a GET request. It works great with many sites (exp. www.msn.com), but others just hang (exp. www.ebay.com) or return an error (exp. www.microsoft.com). I've tried adding additional headers like "Referer" and "Accept", but it doesn't make a difference. What needs to be done to satisfy those web servers that won't cooperate? $link = "http://www.domain.com?param1=string"; $http_response = ""; $url = parse_url($link); $fp = fsockopen($url[host], 80, $err_num, $err_msg, 30) or die("Socket-open failed--error: ".$err_num." ".$err_msg); fputs($fp, "GET /$url[path]?$url[query] HTTP/1.0 "); fputs($fp, "Connection: close "); while(!feof($fp)) { $http_response .= fgets($fp, 128); } fclose($fp); echo $http_response;
View Replies !
Using Fsockopen() And Fputs()
I'm using fsockopen() function to establish connection with server. After I have loop which generate passwords inside that loop I have fputs() to make request to the server and ‘echo’ for testing of my password combination. Since I can see all password combination my loop is working OK, but fputs() it make only one request. Code:
View Replies !
FsockOpen With Http 1.1
I have the following code that needs to be transferred into HTTP 1.1 I am running on windows and wondered if this is an easy undertaking and what to beware of from user experience. PHP Code:
View Replies !
Fsockopen Errors
In the code fragment below $errno and $errstr get set to the system-level errno and strerror() from the connect() call. Does anyone know what the errors below mean an how I may rectify them? $fp = fsockopen($host, $port, $errno, $errstr, 30); Here are the resulting errors I get regardless of what I specify for $host: $errno = "115" $errstr = "Operation now in progress"
View Replies !
Fsockopen Error Need Some Help Thanks
I am using php version 4.3.9 and lets say i have a file on the server called tester.php so i am using fsockopen to point to that file but it gives me a error below. $fh = @fsockopen("http://www.mysite.com/teter.php", "80", $errno, $errstr, 180); 111 Connection refused This server is linux Redhat Enterprise with Apache 2.x Is there anything i need to edit in the php.ini file or apache file.
View Replies !
Fsockopen And Redirect?
I'm attempting to write a script that pulls a list of URLs from my database, checks to see what the last modified date of that URL is, and updates the database with each URL's new last modified timestamp. It's working in most cases right now, but it seems fsockopen can't handle redirects very well according to some google searches. This is especially problematic because most of the URLs I'm checking are RSS feeds and a lot of them redirect to feedburner now for analytics. Code:
View Replies !
Fsockopen() And Telnet
I'm considering using a PHP command line script to retrieve reports from a Linux system. My only source for the report is via telnet. Has anybody here used fsockopen() to interactively script a telnet session in PHP? If so, what problems did you have to overcome. If not, does this sound do-able?
View Replies !
Fsockopen Slow
I'm having an issue with speed at the moment. Basically I have a database with a list of websites on it. I only want to display the sites that are actually 'live'. I've used fsockopen and it does work. Only problem is it takes quite a while. I seem to be waiting at least 10 seconds for it to tell me the site is not responding. It is very quick when the site does exist though. I've played with the optional timeout from fsockopen but I see no difference. Any suggestions? Is there another faster way to check a site is online using php?
View Replies !
POST And Fsockopen()
What I have done is change from one autoresponder company to another I have exported my email lists from previuos company.Now what happens is if I POST via a WEB FORM that email goes into the lead list and no verification s sent to my lead. If I add by fsockopen() the lead is added to my lead list but a confirmation email is sent to my lead. This I want to prevent cause I have changed before and I donot want to get a impression with my leads. Code:
View Replies !
Fopen / Fsockopen
I want to write a simple PHP code to verify whether a given list of URLs is broken or not. The URLs given have various formats, for example .....
View Replies !
Curl Vs Fsockopen
I' m developping a web page html parser. For now I get the page using fsockopen. A friend of mine advised me to use curl, but I don' t really understand why it would be better using curl. That' s why I ask the question : what are the differences between fsockopen and curl?
View Replies !
Fsockopen Timing Out
$who_is = fsockopen($server, 43, $errn,$errstr) or die ("$errn - $errstr"); It simply keeps timing out, I don't know what the issue is, I can connect with telnet just fine. Anyone? Â
View Replies !
Bind IP With Fsockopen
is it possible to socket_bind with fsockopen? im using this... $fs = fsockopen('example.com', 2043, $errno, $errstr, 60); if (!$fs) { fclose($fs); and I need the remote conection to see me as one of my other IP's but cant see how to use it with my above code.
View Replies !
Fsockopen() & Mail()
Currently on a shared server, I contact support now and again. But have discovered that the person on the other end lacks technical expertise, to put it lightly. Until I can get a change of servers, how can I check (phpmyadmin?) if my server supports fsockopen() function and & mail() function?
View Replies !
Fsockopen Error
when using phpmailer I get the following error Warning: fsockopen() [function.fsockopen]: unable to connect to 63.246.152.30:25 (No route to host) in /var/www/vhosts/shoppingcenter-advisor.com/httpdocs/includes/mailer/class.smtp.php on line 105 Message was not sent.Mailer error: Language string failed to load: connect_host I've been trying to google the error but all I find are pages that are suffering the same error lol - can someone point me in the right direction?
View Replies !
Using Fsockopen/fread
I have a page that sends a post request to another page, which generates some data and echos it back to the first page. It works perfectly on my own machine (windows), but when I put it on the live machine (unix), the request page seems to be having superfluous lines being returned. From my logging records, I know that the data is fine before it is sent back, but after it is received by the request page, there is a line with the number 2000 on it after every 242 lines of the data, each line being 32 bytes long. However the last one of these lines is almost always letters. I'm assuming this is a data length in hex, but it doesn't seem to tie up with the calculated length based on 32 (length of each line) * 242.
View Replies !
Fsockopen Available In This Config
I am about to set up a new site where I need to synidcate outside rss feeds on my website. I plan to use a php script which uses fsockopen() function [according to rss fetching software called magpieRSS]. I was about to sign up for the hosting when I discovered on the web that many hosts do not allow "outside" socket connections made from their hosting. In order to be sure, I contacted my webhost and asked if they supported fsockopen, to which they sent information (txt attachment) regarding the PHP commands supported on their service, but I can't find fsockopen anywhere.
View Replies !
Fsockopen() Error
Script: PHP Code: <?php $test = fsockopen ('http://www.chrome.pl', ��'); ?> Result: Code: Warning: fsockopen() [function.fsockopen]: unable to connect to http://www.chrome.pl:8080 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on line 2 Environment: Apache2, PHP5, Ubuntu5
View Replies !
Fsockopen Hanging
I've been building a spider in php for the last few weeks and I’m having continuous problems with downloading pages from the internet. I thought I built a robust program but I just keeps hanging during downloads. Code:
View Replies !
PayPal + Fsockopen
I'm trying to develop an application with paypal and fsockopen may be a solution with curl instead ? I have a page with a form on the site where users enter the id number, mark checkboxes beside the agreement and enter an email address as their username. After user submits the form it posts back to the script on my server to parse the information entered in the form and if everything is ok script takes him/her directly to the PayPal screen (using fsockopen). Code:
View Replies !
Fsockopen - ERROR 0x030
I have done a search and found a few scripts and the method to use fsockopen to post data to a perl script on a third party server while also posting the data to my mySQL database. My problem at the moment while I am seeing if it will even work is that it connects but I get the above error in the message: HTTP/1.1 200 OK Date: Fri, 05 Sep 2003 09:01:28 GMT Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-15 b ERROR 0x03 0 The way it should work is you upload a html template and it puts the form in for you the only thing I can think is that it is refusing connections from off the server the actual script is on (it is for a hosting reseller form).
View Replies !
Fsockopen() And Secure/SSL Connections?
Okay, this is probably a silly question, but I'm wondering if it's actually possible to obtain a secure HTTP form Post via fsockopen()? I know that I can pass post data via the function and it's headers.. however, my situation requires that the connection be secure. As I would be passing POST data to a merchant gateway server.
View Replies !
Using Fopen, Fsockopen Or Curl
I have big problem with using fopen, fsockopen or curl. if i tried to use it on remote site it doesn't works. i've readed to much posts but didn't found anything helpfulll. fopen just give permission denied. ........
View Replies !
Socket_create Versus Fsockopen
I noticed that when I use socket_create and socket_connect that the socket goes into CLOSE_WAIT state immediately after receiving data. Even when I don't use socket_close on the socket resource. Another weird thing is that they stay in this state until the server gets booted. When I use fsockopen it works as expected, i.e. when I don't call fclose on the socket resource the socket state remains ESTABLISHED. I'm not sure if this has something to do with the fact that I tried it on a Windows server, but is this a bug, or is it supposed to behave like this?
View Replies !
Fsockopen Sending Variables
I want to send 10 variables to a other server where i already got an recieve page my problem is how do i send the variables? Is it possible to do it by posting the variables? if i add it behind the (recall/comein2.php) part it fails PHP Code:
View Replies !
$SMTP = Fsockopen(mail.example.org, 25);
I tried the following posted by Nickoons and get a parse error: unexpected T-string in this line - $SMTP = fsockopen("mail.example.org", 25); I had the same issue. My old server worked fine.. and when I migrated the site to its own dedicated box, this function stopped working even though sendmail was working just fine. I also noticed that PHP's mail() function is very slow. I run a mailing list, and I created a web-based system to manage and deploy all of these emails. I ended up creating my own function to replace PHP's mail() function, which A) works on my new system, and B) is many times faster than PHP's mail() function. Here it is, in case you'd like to use it. It uses sockets to connect directly to the SMTP server of your choice: function SendMail($ToName, $ToEmail, $FromName, $FromEmail, $Subject, $Body, $Header) { $SMTP = fsockopen("smtp.sitename.com", 25); $InputBuffer = fgets($SMTP, 1024); fputs($SMTP, "HELO sitename.com"); $InputBuffer = fgets($SMTP, 1024); fputs($SMTP, "MAIL From: $FromEmail"); $InputBuffer = fgets($SMTP, 1024); fputs($SMTP, "RCPT To: $ToEmail"); $InputBuffer = fgets($SMTP, 1024); fputs($SMTP, "DATA"); $InputBuffer = fgets($SMTP, 1024); fputs($SMTP, "$Header"); fputs($SMTP, "From: $FromName <$FromEmail>"); fputs($SMTP, "To: $ToName <$ToEmail>"); fputs($SMTP, "Subject: $Subject"); fputs($SMTP, "$Body."); fputs($SMTP, "QUIT"); $InputBuffer = fgets($SMTP, 1024); fclose($SMTP); } I believe I've modified the script sufficiently that it doesn't include anything specific to my configuration.. I apologize if I haven't. You'll need to replace "smtp.sitename.com" and "sitename.com" with your server's information.
View Replies !
Proxy Auth Using Fsockopen
Trying to make a connection via a proxy to another site using the fsockopen I can get it hitting the proxy server just can't get it through. I have user name and password to get through the proxy... but how exactly do I make it work using the fsockopen?
View Replies !
|