Sample vim2html output


 1  <?php
 2  /*
 3   +-----------------------------------+
 4   | Simple WHOIS - Chip Cuccio        |
 5   | Created Nov. 19, 2002             |
 6   | <http://norlug.org/~chipster/>    |
 7   +-----------------------------------+
 8  */
 9
10  // If "?show_source" argument is NOT true, show the HTML page
11  if ($show_source != true) {
12      print("<html>\n"
13            ."<head>\n"
14            ."<title>PHP Whois</title>\n"
15            ."<style type=\"text/css\">\n"
16            ."body { background-color: #FFFFFF; color: #000000; }\n"
17            .":link { color: #000099 }\n"
18            .":visited { color: #000099 }\n"
19            .":active { color: #CC0000 }\n"
20            ."h1,h2,h3,h4,h5 { font-family: Arial, Helvetica, sans-serif }\n"
21            ."</style>\n"
22            ."</head>\n"
23            ."<body>\n"
24            ."\n"
25            ."<h2>PHP Whois:</h2>\n"
26            ."<form method=\"post\" action=\"$PHP_SELF\">\n"
27            ."<strong>Domain Name:</strong><br />\n"
28            ."<input name=\"domain\" size=\"20\" maxlength=\"255\" />\n"
29            ."<br />\n"
30            ."<input type=\"submit\" value=\"Submit\">\n"
31            ."<input type=\"reset\" value=\"clear\">\n"
32            ."<br />\n"
33            ."</form>\n"
34            ."<hr />\n");
35
36      // strip out any "www." in the query...whois won't work
37      if (ereg("www.", $domain)) {
38          $domain = (str_replace("www.", "", $domain));
39      }
40
41      // Define the WHOIS Function ($fsock should work in all platforms)
42      function whois($domain, $server = "whois.networksolutions.com") {
43          $fp = fsockopen ($server, 43, &$errnr, &$errstr) or die("$errno: $errstr");
44          fputs($fp, "$domain\n");
45          while (!feof($fp))
46              echo fgets($fp, 2048);
47          fclose($fp);
48      }
49
50      // If a domain name is specified, do the deed, else, just finish the html.
51      if ($domain != "") {
52          print("<pre>");
53          whois($domain);
54          print("</pre>\n<hr />\n");
55      }
56
57      // end of html in page
58      print("<h4><a href=\"$PHP_SELF?show_source=true\">Show Source Code</a></h4>\n"
59            ."</body>\n"
60            ."</html>\n");
61
62  // If "?show_source" argument is true, show the source!
63  } else {
64      print("<html>\n"
65            ."<head>\n"
66            ."<title>PHP Whois (Source Code View)</title>\n"
67            ."<style type=\"text/css\">\n"
68            ."body { background-color: #FFFFFF; color: #000000; }\n"
69            .":link { color: #000099 }\n"
70            .":visited { color: #000099 }\n"
71            .":active { color: #CC0000 }\n"
72            ."h1,h2,h3,h4,h5 { font-family: Arial, Helvetica, sans-serif }\n"
73            ."</style>\n"
74            ."</head>\n"
75            ."<body>\n"
76            ."<h2>PHP Whois; source code view:</h2>\n"
77            ."<h4><a href=\"$PHP_SELF\">\n"
78            ."See the HTML output of this script</a></h4>\n<hr /><br>\n");
79      show_source($PATH_TRANSLATED);
80      print("\n<hr />\n<h4><a href=\"$PHP_SELF\">\n"
81            ."See the HTML output of this script</a></h4>\n</body>\n"
82            ."</html>\n");
83  }
84
85  ?>
86

Generated with vim2html
Copyright © 2003 by Chip Cuccio <http://norlug.org/~chipster/?finger>