/[health_html]/inc/harrison.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /inc/harrison.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Tue Oct 23 16:13:59 2001 UTC (22 years, 6 months ago) by ravilov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Added an author's CV. Added a secondary main article. Added the Related fields to news editor, and also fixed some bugs in it. Other bugfixes and improvements.

1 ravilov 1.1 <?php
2     function Forbidden() {
3     Header("HTTP/1.0 403");
4     echo "You are not allowed to access this document.\n";
5     exit;
6     }
7     function Error($errno) {
8     echo "<b>GreĀ¹ka!</b><br>".strerror($errno)." (".$errno.")<BR>\n";
9     exit;
10     }
11     $host = $HTTP_REFERER;
12     if (!$host) Forbidden();
13     $host2 = ereg_replace("^http://([^/]+)/.*$", "\\1", $host);
14     if ($host2) $host = $host2;
15     $host = gethostbyname($host);
16     if (strpos("195.29.208.", $host) != 0) Forbidden();
17     $fd = fsockopen(gethostbyname("www.harrisonsonline.com"), 80, &$errno);
18     if (!$fd) Error($errno);
19     $qry = "id=pliva&password=harrisons";
20     fputs($fd, "POST /server-java/Arknoid/amed/harrisons/co_chapters/ch001/ch001_p01.html HTTP/1.0\r\n");
21     fputs($fd, "Host: www.harrisonsonline.com\r\n");
22     fputs($fd, "Content-Type: application/x-www-form-urlencoded\r\n");
23     fputs($fd, "Content-Length: ".strlen($qry)."\r\n");
24     fputs($fd, "Connection: keep-alive\r\n");
25     fputs($fd, "\r\n");
26     fputs($fd, $qry);
27     $cookies = array();
28     while (!feof($fd)) {
29     $line = chop(fgets($fd, 4096));
30     if ($line == "") break;
31     $pos = strpos(strtoupper($line), "SET-COOKIE:");
32     if ($pos === false) continue;
33     if ($pos == 0) array_push($cookies, $line");
34     }
35     fclose($fd);
36     Header("Location: http://www.harrisonsonline.com/");
37     for ($i = 0; $i < count($cookies); $i++) Header($cookies[$i]);
38     ?>

  ViewVC Help
Powered by ViewVC 1.1.26