"Fossies" - the Fresh Open Source Software Archive

Member "mythreads/docs_info/websec.php3" (10 May 2004, 1191 Bytes) of package /linux/privat/mythreads-links_1.2.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "websec.php3": 1.2.0_vs_1.2.1.

    1 <?
    2 # $Id: websec.php3,v 1.5 2004-05-10 21:05:59 ldrolez Exp $
    3 #
    4 # Copy this script to the root of your site in order to generate
    5 # WebSec monitoring scripts with websec-gen.pl
    6 #
    7 header("Content-Type: text/plain");
    8 function init_templates() { return new Template(); }
    9 
   10 # Edit me to point to the config.php3 on your site.
   11 require("./lib/phplib/template.inc");
   12 include "config.php3";
   13 
   14 # put a password here
   15 if ($pass != "mypass") {
   16     die("wrong password");
   17 }
   18 
   19 if (!($mylink = mysql_connect( $host, $username, $password)))          
   20 {                                                                       
   21     print  "<h3>could not connect to database</h3>\n";              
   22     exit;                                                           
   23 }                                                                       
   24 mysql_select_db($database);
   25 
   26 $cmd = "SELECT title,link from ".$config["pre"]."links ORDER BY title WHERE status=0";
   27 $result = mysql_query($cmd) or die (mysql_error());
   28 
   29 while ($list = mysql_fetch_array($result) )
   30 {
   31     if (substr($list[link], 0, 4) == "http" ) {
   32     # only http links
   33         print "$list[title]\n";
   34     print "$list[link]\n";
   35     }
   36 }
   37 
   38 mysql_close($mylink);
   39 
   40 ?>