[ Index ] |
|
Code source de Cr@wltr@ck 2.2.1 |
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: adminsite.php 14 //---------------------------------------------------------------------- 15 16 if (!defined('IN_CRAWLT_ADMIN')) 17 { 18 echo"<h1>Hacking attempt !!!!</h1>"; 19 exit(); 20 } 21 22 $sitenamedisplay=htmlentities($sitename); 23 $siteurldisplay=htmlentities($siteurl); 24 25 //valid form 26 27 if($validsite==1 && $sitename=='') 28 { 29 echo"<br><br><p>".$language['site_no_ok']."</p>"; 30 31 32 $validsite=0; 33 echo"<div class=\"form\">\n"; 34 echo"<form action=\"index.php\" method=\"POST\" >\n"; 35 echo "<input type=\"hidden\" name ='validform' value='4'>\n"; 36 echo "<input type=\"hidden\" name ='navig' value='6'>\n"; 37 echo "<input type=\"hidden\" name ='sitename' value='$sitenamedisplay'>\n"; 38 echo "<input type=\"hidden\" name ='siteurl' value='$siteurldisplay'>\n"; 39 echo"<input name='ok' type='submit' value=' ".$language['back_to_form']." ' size='20'>\n"; 40 echo"</form>\n"; 41 echo"</div>\n"; 42 } 43 else 44 { 45 //database connection 46 $connexion = mysql_connect($crawlthost,$crawltuser,$crawltpassword) or die("MySQL connection to database problem"); 47 $selection = mysql_select_db($crawltdb) or die("MySQL database selection problem"); 48 49 if($validsite !=1) 50 { 51 //form to add site in the database 52 53 echo"<br><br><p>".$language['set_up_site']."</p>\n"; 54 echo"</div>\n"; 55 56 57 echo"<div class=\"form\">\n"; 58 echo"<form action=\"index.php\" method=\"POST\" >\n"; 59 echo "<input type=\"hidden\" name ='navig' value='6'>\n"; 60 echo "<input type=\"hidden\" name ='validform' value=\"4\">"; 61 echo "<input type=\"hidden\" name ='validsite' value=\"1\">"; 62 echo"<table class=\"centrer\">\n"; 63 echo"<tr>\n"; 64 echo"<td>".$language['site_name']."</td>\n"; 65 echo"<td><input name='sitename' value='$sitenamedisplay' type='text' maxlength='45' size='50'/></td>\n"; 66 echo"</tr>\n"; 67 echo"<tr>\n"; 68 echo"<td>".$language['site_url']."</td>\n"; 69 echo"<td><input name='siteurl' value='$siteurldisplay' type='text' maxlength='250' size='50'/></td>\n"; 70 echo"</tr>\n"; 71 echo"<tr>\n"; 72 echo"<td colspan=\"2\">\n"; 73 echo"<br>\n"; 74 echo"<input name='ok' type='submit' value=' OK ' size='20'>\n"; 75 echo"</td>\n"; 76 echo"</tr>\n"; 77 echo"</table>\n"; 78 echo"</form>\n"; 79 } 80 else 81 { 82 //add the site in the database 83 84 //check if site already exist 85 86 87 $sqlexist = "SELECT * FROM crawlt_site 88 WHERE name='".sql_quote($sitename)."'"; 89 90 $requeteexist = mysql_query($sqlexist, $connexion) or die("MySQL query error"); 91 92 $nbrresult=mysql_num_rows($requeteexist); 93 94 if($nbrresult>=1) 95 { 96 //site already exist 97 98 echo"<br><br><h1>".$language['exist_site']."</h1>\n"; 99 100 101 echo"<form action=\"index.php\" method=\"POST\" >\n"; 102 echo "<input type=\"hidden\" name ='navig' value='6'>\n"; 103 echo"<table class=\"centrer\">\n"; 104 echo"<tr>\n"; 105 echo"<td colspan=\"2\">\n"; 106 echo"<input name='ok' type='submit' value='OK' size='20'>\n"; 107 echo"</td>\n"; 108 echo"</tr>\n"; 109 echo"</table>\n"; 110 echo"</form>\n"; 111 112 } 113 else 114 { 115 116 //the site didn't exist, we can add it in the database 117 118 119 120 $sqlsite2="INSERT INTO crawlt_site (name, url) VALUES ('".sql_quote($sitename)."','".sql_quote($siteurl)."')"; 121 $requetesite2 = mysql_query($sqlsite2, $connexion) or die("MySQL query error"); 122 123 //check is requete is successfull 124 125 if($requetesite2==1) 126 { 127 echo"<br><br><p>".$language['site_ok']."</p>\n"; 128 129 //continue 130 131 echo"<form action=\"index.php\" method=\"POST\" >\n"; 132 echo "<input type=\"hidden\" name ='navig' value='6'>\n"; 133 echo"<table class=\"centrer\">\n"; 134 echo"<tr>\n"; 135 echo"<td colspan=\"2\">\n"; 136 echo"<input name='ok' type='submit' value='OK ' size='20'>\n"; 137 echo"</td>\n"; 138 echo"</tr>\n"; 139 echo"</table>\n"; 140 echo"</form>\n"; 141 } 142 } 143 } 144 145 } 146 147 148 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Sep 6 14:14:11 2007 | par Balluche grâce à PHPXref 0.7 |