fsockopen

PayPal IPN and fsockopen

穿精又带淫゛_ 提交于 2020-01-06 19:56:16
问题 Well I can't use cURL, the version installed on my web host that can't be changed doesn't support TLS. I'm trying to use fsockopen now to see if i'll be able to use IPN. It just hangs and browser throws connection timeout. PHP 7, open_ssl is enabled <?php header('HTTP/1.1 200 OK'); $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST[

Is there a way to check if a host is up?

浪子不回头ぞ 提交于 2020-01-06 02:52:06
问题 I'm trying to do this in PHP. I need to check if a specified host is "up" I thought of pinging the specified host (though I'm not sure how I would, since that would require root. --help here?) I also though of using fsockopen() to try to connect on a specified port, but that would fail too, if the host wasn't listening for connections on that port. Additionally, some hosts block ping requests, so how might I get around this? This part isn't a necessity, though, so don't worry about this too

How to get output, when using fsockopen to open a php page?

随声附和 提交于 2020-01-05 10:10:53
问题 when I use fsockopen to open a php page, the code works fine, but there are some other problems. For Example: if I open b.php in a.php, "echo" won't work in b.php, error message neither(these 2 things works fine on common page). This makes debug very difficult. How to get output in page b? Thanks a lot! here is my code. I use main.php to call main_single_block.php.PS: all things work fine except the 2 things I mentiond above. main.php: $template_url_arr_s = serialize($template_url_arr); $fp =

Which is better approach between fsockopen and curl?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-01 08:23:12
问题 I am creating an app for Automated Recurring Billing. Please let me know which option should I opt for sending the request to server fsockeopen curl and why one is better than another? 回答1: i would recommend you curl, because of the configurable options. e.g. ssl 回答2: I would recommend using PHP's stream contexts with the built in functions: http://us3.php.net/manual/en/book.stream.php . Full HTTP/S functionality and integrates nicely with fopen / file_get_contents functions. You can (for

PHP connect to external ip with port

柔情痞子 提交于 2019-12-25 08:49:54
问题 I have a dedicated server running a MSSQL and an apache server, only listening to port 8080 (the apache), and i have some XML in there that i want to access from another domain(hosted server). I tried fsockopen like this: <?php $fp = fsockopen("199.175.125.222", 8080, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host: www.example.com\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { echo

PHP Checking if a port is Active

点点圈 提交于 2019-12-25 06:27:21
问题 I'm in the process of creating my own service status script as both a chance to become more familiar with the PHP language and to design it from the ground up as being as efficient as possible for my needs. A section of my code used in both my cron job and testing a connection parts queries the IP/Port of a service to make sure it is online. My issue is that the script simply queries whether the port is "Unblocked" on that IP so if for instance I was querying port 21 with an FTP server and

PHP Checking if a port is Active

元气小坏坏 提交于 2019-12-25 06:27:16
问题 I'm in the process of creating my own service status script as both a chance to become more familiar with the PHP language and to design it from the ground up as being as efficient as possible for my needs. A section of my code used in both my cron job and testing a connection parts queries the IP/Port of a service to make sure it is online. My issue is that the script simply queries whether the port is "Unblocked" on that IP so if for instance I was querying port 21 with an FTP server and

PHP - Get image with fsockopen

僤鯓⒐⒋嵵緔 提交于 2019-12-25 01:49:54
问题 I am trying to grab an image from an external server with fsockopen in PHP. I need to get the image data into a variable in BASE64 encoding in my code. The image is a .jpeg file-type and is a small image. I could not find any answers on Google after some searching. So i wonder if it is even directly possible without weird workarounds? Any help and/or suggestions is much appreciated! Note that allow_url_fopen is disabled on my server due to security threats. This is my current code: $wn_server

curl or fsockopen for paypal ipn

爷,独闯天下 提交于 2019-12-24 01:33:09
问题 What advantages does one have over the other? Paypal recommends using fsockopen however there are many scripts on the internet which use curl . Which one shall I use? Curl: http://www.namepros.com/code/306043-process-paypal-ipn-with-curl.html fsockopen: https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNImplementation 回答1: I don't really think it matters one way or another, except that in certain Apache2 installs there could be either availability

fsockopen 10053 error when writing Chars to Java socket

一个人想着一个人 提交于 2019-12-20 06:29:57
问题 Right, I'm trying to write a wee script in PHP that will send an in game chat package to Minecraft. //Deliberately low timeout $mc = fsockopen("localhost", 25565, $errno, $err, 3); Now, if that connects successfully, then I send 2 "packets". A single byte with the integer 3 in it to tell Minecraft that it should handle the incoming network traffic as a Packet3Chat "packet": fwrite( $mc, strrev( pack( "C", 3 ) ) ); This appears to work A-OK**. The second "packet" that is required is the length