summaryrefslogtreecommitdiffstats
path: root/application/Functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/Functions.php')
-rw-r--r--application/Functions.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/application/Functions.php b/application/Functions.php
index 9e2ccf5..161badb 100644
--- a/application/Functions.php
+++ b/application/Functions.php
@@ -39,4 +39,25 @@ function print_a(){
print_r($a);
echo "</pre>";
}
+}
+
+function PostToHost($host, $path, $referer, $data_to_send) {
+ $fp = fsockopen($host, 80);
+ printf("Open!\n");
+ fputs($fp, "POST $path HTTP/1.1\r\n");
+ fputs($fp, "Host: $host\r\n");
+ fputs($fp, "Referer: $referer\r\n");
+ fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
+ fputs($fp, "Content-length: ". strlen($data_to_send) ."\r\n");
+ fputs($fp, "Connection: close\r\n\r\n");
+ fputs($fp, $data_to_send);
+ printf("Sent!\n");
+ $res = "";
+ while(!feof($fp)) {
+ $res .= fgets($fp, 128);
+ }
+ printf("Done!\n");
+ fclose($fp);
+
+ return $res;
} \ No newline at end of file