<?php $sHTTPa = "GET /frontend/Xskin/mail/doaddpop.html?email=anewuser&domain=wrjournal.net&password=mynewpass"a=2 HTTP/1.0\r\nAuthorization: Basic d3J364bitpass9yZDE=\r\n"; $hSocket = fsockopen("www.wrjournal.net", 2082); fputs($hSocket, $sHTTPa); fclose($hSocket); ?> Dont work, and i dont know how to see what is happening.
Try this: PHP: <?php $sHTTPa = "GET /frontend/Xskin/mail/doaddpop.html?email=anewuser&domain=wrjournal.net&password=mynewpass"a=2\r\n"; $sHTTPa .= "HTTP/1.0\r\n"; $sHTTPa .= "Authorization: Basic d3J364bitpass9yZDE=\r\n\r\n"; // Broke it up into lines for easier reading $hSocket = fsockopen("www.wrjournal.net", 2082, $errno, $errstr, 30); if (!$hSocket ) { print ("$errstr ($errno)<br>"); // Tells you if there are any errors with the connection } else { fputs($hSocket, $sHTTPa); /* Other stuff in here, etc */ } fclose($hSocket); ?>
I know it is different depending on who is receiving it, but I've always used just the newline escape "\n" without the carriage return "\r" so maybe Code: <?php $sHTTPa = "GET /frontend/Xskin/mail/doaddpop.html?email=anewuser&domain=wrjournal.net&password=mynewpass"a=2\n"; $sHTTPa .= "HTTP/1.0\n"; $sHTTPa .= "Authorization: Basic d3J364bitpass9yZDE=\n\n"; // Broke it up into lines for easier reading $hSocket = fsockopen("www.wrjournal.net", 2082, $errno, $errstr, 30); if (!$hSocket ) { print ("$errstr ($errno)<br>"); // Tells you if there are any errors with the connection } else { fputs($hSocket, $sHTTPa); /* Other stuff in here, etc */ } fclose($hSocket); ?> Come to think of it, I've never used \r, even in http headers and whatnot, but I have read that it is neccessary in some cases.
So you have successfully used \n in http headers? i cant try it right now where i am, but i will in 5-8 hrs.
Actually I just realized I was thinking back on some mail headers I did a few weeks ago for all that carbon copy, blind carbon copy, text format, etc... The only time I've done something like what you're doing I copied the code... it was for paypals Instant Purchase Notification, which hasn't worked for me yet But yes, they used \r\n for each of the carriage returns: PHP: <?php $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); ?> Since I don't know much about fsockopen and fgets and all that good stuff yet, I'm not sure how well it works... I need to straighten out the script a bit before I'm sure if it works or not.
I have been working with it, with NO success. I need to say i want the HTTP /1.0 after the GET because I know it works there. I have successfully done it through telnet many times. PHP: <?php $sHTTPa = "GET /frontend/Xskin/mail/doaddpop.html?email=anewuser&domain=wrjournal.net&password=mynewpass"a=2 HTTP/1.0\r\n"; $sHTTPa .= "Authorization: Basic d3J364bitpass9yZDE=\r\n\r\n"; // Broke it up into lines for easier reading $hSocket = fsockopen("www.wrjournal.net", 2082, $errno, $errstr, 30); if (!$hSocket ) { print ("$errstr ($errno)<br>"); // Tells you if there are any errors with the connection } else { fputs($hSocket, $sHTTPa); /* Other stuff in here, etc */ } fclose($hSocket); ?> If anyone has anyother methods of just loading a page/sending headers, i am open, i dont care that i use fsockopen. Its not important, all that is important, is i find someway to work with the HTTP Protocal, in php. Whys the world of php so cruel? O ya, OneSeventeen: How does the headers get sent in your code? You know much about paypal? I will be working with that in a few weeks if i ever get this to work.