Post Data via Socket
Copy and paste the following code into your editor and run it (code comments are included). If you want to see the live result (we believe this is the best way to learn what is the script about), try it here (new window). The source code This example uses the fsockopen to connect to an url which can be via any port (even the ssl one), posts some data and reads the output page as well as the headers. download the file
Notes:
- we use the fsockopen and the fputs functions to open a socket and write throught it;
- in order to use the ssl port, we will need to have openssl compiled into PHP;
- you can retrieve and send session and cookies ids from reading and writing in headers; and often you will need these data in order to access the results from a post request.
You may wish to read additional materials from:
- http://us.php.net/fsockopen
- manual/en/function.fgets.php
- function.fputs.php
- manual/en/transports.php
Post a comment
|
Webmaster Corner
The ClickBnk Code
Another Killer Product From Michael Jones, simply follow the Blueprint For Easy Online Wealth Using Click Bank...
Twitter Traffic Machine The Automated Growth & Money Making System from growing A Twitter Account Rapidly W/total Automation Via 5 Videos!
iPowerWeb

Incredible Membership Packages - Web Hosting!
→ Maverick Money Makers - Get Paid For Life!
|
Categories
|