[ Index ]
 

Code source de Cr@wltr@ck 2.2.1

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/include/ -> update.php (source)

   1  <?php
   2  //----------------------------------------------------------------------

   3  //  CrawlTrack 2.2.1

   4  //----------------------------------------------------------------------

   5  // Crawler Tracker for website

   6  //----------------------------------------------------------------------

   7  // Author: Jean-Denis Brun

   8  //----------------------------------------------------------------------

   9  // Website: www.crawltrack.fr

  10  //----------------------------------------------------------------------

  11  // That script is distributed under GNU GPL license

  12  //----------------------------------------------------------------------

  13  // file: update.php

  14  //----------------------------------------------------------------------

  15  
  16  if (!defined('IN_CRAWLT_ADMIN'))
  17  {
  18      echo"<h1>Hacking attempt !!!!</h1>";
  19      exit();
  20  }
  21  
  22  //crawlt_update table creation if not exist in case of upgrade from a previous version

  23  
  24  //check if table already exist

  25  
  26  $connexion = mysql_connect($crawlthost,$crawltuser,$crawltpassword) or die("MySQL connection to database problem");
  27  $selection = mysql_select_db($crawltdb) or die("MySQL database selection problem");
  28  
  29  
  30  
  31  $table_exist6 = 0;
  32  
  33  $sql = "SHOW TABLES ";                                                
  34  $tables = mysql_query($sql, $connexion) or die("MySQL query error"); 
  35  
  36  while (list($tablename)=mysql_fetch_array($tables)) 
  37      {
  38  
  39      if($tablename == 'crawlt_update')
  40          {
  41          $table_exist6 = 1;
  42          }
  43      }
  44  
  45  
  46  if($table_exist6 == 0)
  47      {
  48      //the table didn't exist, we have to create it

  49                      
  50      $result7 = mysql_query("CREATE TABLE crawlt_update (
  51        idcrawlt_update INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  52        update_id INTEGER UNSIGNED NULL,
  53      PRIMARY KEY(idcrawlt_update)
  54      )") or die("MySQL query error");
  55                                          
  56      if($result7==1)
  57          {
  58          $result8 =mysql_query("INSERT INTO crawlt_update VALUES (1,'0')") or die("MySQL query error");
  59          $idlastupdate=0;
  60          $testtable=1;
  61          }
  62      if($result7!=1 OR $result8!=1)
  63          {
  64          //table not created

  65          $testtable=0;
  66          }            
  67                          
  68      }
  69  else
  70      {
  71      
  72      //requete to get the actual liste id

  73      
  74      $sqlupdate = "SELECT * FROM crawlt_update";
  75  
  76      $requeteupdate = mysql_query($sqlupdate, $connexion) or die("MySQL query error");
  77  
  78      $idlastupdate=0;
  79  
  80      while ($ligne = mysql_fetch_object($requeteupdate))                                                                              
  81          {
  82          $update=$ligne->update_id; 
  83          if($update>$idlastupdate)
  84              {
  85              $idlastupdate=$update;
  86              }        
  87          }
  88      //table ok    

  89      $testtable=1;                
  90                      
  91      }
  92  
  93  
  94  if($testtable==0)
  95      {
  96      //case we had a problem during table creation

  97      echo"<br><br><h5>".$language['step1_install_no_ok3']."</h5><br><br>";
  98      }
  99  else
 100      {
 101          echo"<br><br><h1>".$language['update_title']."</h1>\n";
 102          
 103          echo"<h2>".$language['your_list']."&nbsp;Crawlerlist $idlastupdate</h2>\n";
 104          echo"<h2>".$language['crawltrack_list']."&nbsp;<iframe name=\"I1\" src=\"http://www.crawltrack.fr/listcrawler/infolistid.htm\" marginwidth=\"1\" marginheight=\"1\" scrolling=\"no\" border=\"0\" frameborder=\"0\" width=\"150px\" height=\"23px\"></iframe></h2>\n";
 105      
 106          
 107          echo"<div class=\"form\">\n";
 108      
 109          echo"<h2><form action=\"index.php\" method=\"POST\" >\n";
 110          echo "<input type=\"hidden\" name ='validform' value='14'>\n";
 111          echo "<input type=\"hidden\" name ='navig' value='6'>\n";
 112          echo"<input name='ok' type='submit'  value='".$language['update_crawler']."' size='20'>\n";
 113          echo"</form><br>\n";
 114  
 115          echo"<form action=\"index.php\" method=\"POST\" >\n";
 116          echo "<input type=\"hidden\" name ='navig' value='6'>\n";
 117          echo"<input name='ok' type='submit'  value='".$language['no_update']."' size='20'>\n";
 118          echo"</form></h2>\n";        
 119          
 120          
 121          
 122          echo"</div><br>\n";
 123  
 124          }
 125  
 126  
 127  
 128  ?>


Généré le : Thu Sep 6 14:14:11 2007 par Balluche grâce à PHPXref 0.7