- Katılım
- 27 Kasım 2007
- Mesajlar
- 0
- Reaction score
- 0
merhaba arkadaslar elimde bir script var ve son arananlari listelemek istiyorum admin panelinde son aranan kelimeleri kendisi gösteriyor onun kodu su
..............................................................................................
<?php
include('header.php');
include('admin-functions.php');
$act = $_GET['do'];
switch($act){
default:
case 'default':
echo "<h2>Search statistics</h2>";
$sql = "SELECT COUNT(*) AS count FROM `ura_searches";
$result = mysql_query($sql);
if( !$result )
die(mysql_error());
$row = mysql_fetch_assoc($result);
$totals = $row['count'];
$sql = "SELECT * FROM `ura_searches` WHERE string != '' ORDER BY `hits` DESC LIMIT 15";
$result = mysql_query($sql);
if( !$result )
die(mysql_error());
echo "<div>";
echo "<p>There are ".$totals." unique keywords.</p>";
while( $row = mysql_fetch_assoc($result) ) {
echo "<h4>'".$row['string']."'</h4>Searched ".$row['hits']." time(s).<br /><br />";
}
if( $totals > 25 ) {
echo "<p><a href=\"stats.php?do=searches\">Show me the rest »</a></p>";
}
echo "</div>";
break;
case 'searches' :
$sql = "SELECT * FROM `ura_searches` ORDER BY `hits` DESC LIMIT 50";
$result = mysql_query($sql);
$totals = mysql_num_rows($result);
if( !$result )
die(mysql_error());
echo "<div>";
echo "<p>There are ".$totals." unique keywords.</p>";
while( $row = mysql_fetch_assoc($result) ) {
echo "<h4>'".$row['string']."'</h4>Searched ".$row['hits']." time(s).<br /><br />";
}
break;
}
include('footer.php');
?>
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
admin funcistion dosyasida bu
.............................................................................................
<?php
//settings.php functions
function validate_email($email) {
return eregi("^[a-z0-9]+[a-z0-9_.-]*@[a-z0-9]+[a-z0-9_.-]*\.[a-z]{2,4}$",$email);
}
function edit_profile_form($method = "post", $action = "settings.php?do=edit", $username, $email, $message){
if( isset($message) ) {
$ret = $message."<br />";
}
else $ret = "";
$ret .= "<form name=\"edit-profile\" method=\"".$method."\" action=\"".$action."\">";
$ret .= " <label><strong>Username</strong>:<br>";
$ret .= " <input type=\"text\" name=\"user\" value=\"".$username."\" class=\"inputtext\" /><br />";
$ret .= " </label><label>";
$ret .= " <strong>Your current password</strong>:<br>";
$ret .= " <input type=\"password\" name=\"current\" class=\"inputtext\"/><span style=\"font-size: 10px; color: #999;\">* Enter your current password should you change anything.</span><br>";
$ret .= " </label><label>";
$ret .= " <strong>New Password</strong>:<br>";
$ret .= " <input type=\"text\" name=\"newpass\" class=\"inputtext\"/><span style=\"font-size: 10px; color: #999;\">* Leave blank if you don't want to change your password.</span>";
$ret .= " </label><br />";
$ret .= " <label><strong>E-mail</strong>:<br>";
$ret .= " <input type=\"text\" name=\"email\" value=\"".$email."\" class=\"inputtext\" />";
$ret .= " </label>";
$ret .= " <br />";
$ret .= " <label>";
$ret .= " <input type=\"submit\" name=\"Submit\" value=\"Submit\" class=\"inputbutton\" />";
$ret .= " </label>";
$ret .= " </form>";
return $ret;
}
//--------------------------
//ads.php functions
function edit_ad_form($method = "post", $action = "ads.php?do=add", $title, $html, $message){
if(isset($message))
$ret = $message."<br />";
else $ret = "";
$ret .= "<div id=\"error_msg\">It's important that you don't leave any blank fields! After submitting this form your AD will instantly appear on your website.</div>";
$ret .= "<form method=\"".$method."\" action=\"".$action."\">";
$ret .=" <strong>Ad Title:</strong> <br> <input type=\"text\" name=\"title\" value=\"".$title."\" class=\"inputtext\" /><br />";
$ret .=" <strong>HTML Code:</strong> <br> The maximum ad size is: 300 x 250 <br> <textarea name=\"html\" class=\"inputtext\" cols=\"80\" rows=\"10\" >".$html."</textarea><br />";
$ret .=" <input name=\"Submit\" type=\"submit\" value=\"Save\" class=\"inputbutton\" /><br />";
$ret .=" </form>";
return $ret;
}
//------------------------
//login.php functions
function login_form($username, $error = ""){
echo'<div id="login_screen">
<div class="login_form">
'.$error.'
<form action="login.php" method="post" name="login-form">
Username: <br><input name="user" type="text" size="50" value="'.$username.'"/><br />
Password: <br><input name="pass" size="50" type="password" /><br />
<input type="submit" class="submit" value="Login" name="Submit" /><br />
<a href="forgot.php">Did you forget your password ?</a>
</form>
</div>
</div>';
}
function rand_pass($length = 5)
{
$smallcaps = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
$caps = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
$nums = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$keyVals = array();
$key = array();
$keyVals = array_merge($smallcaps, $caps, $nums);
for($i = 0; $i < $length; $i++)
{
$r = rand(0,count($keyVals)-1);
$key[$i] = $keyVals[$r];
}
return implode("", $key);
}
//-----------------------
//manager.php functions
function edit_form($mode, $action = "manager.php", $val = array(), $message){
$ret = '';
if( isset($message) ) {
$ret .=$message."<br />";
}
$ret .= '
<form name="manage-item" method="post" action="'.$action.'">
<table width="75%" border="0" cellpadding="4" cellspacing="0">';
if(strtolower($mode) == 'add') {
$ret .= '
<tr>
<td><strong>Product ID</strong></td>
<td><input type="text" name="ProductID" value="'.stripslashes($val['ProductID']).'" size="40" class="inputtext"></td>
</tr>
';
}
$ret .= '
<tr>
<td><strong>Product Name</strong></td>
<td><input type="text" name="ProductName" value="'.stripslashes($val['ProductName']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Category</strong></td>';
$result = @mysql_query("SELECT * FROM `ura_category`");
if( !result )
die(mysql_error());
$ret .= '<td><select name="CategoryID" size="1" class="inputtext">';
while( $row = mysql_fetch_assoc($result) ) {
if($val['CategoryID'] == $row['catid'] ) {
$ret .= '<option value="'.$row['catid'].'" selected>'.$row['name'].'</option>';
}
else
$ret .= '<option value="'.$row['catid'].'">'.$row['name'].'</option>';
}
$ret .= '</select></td>';
$ret .= '
</tr>
<tr>
<td><strong>Price</strong><br /><span style="font-size: 10px">(Enter numerical value only)</span></td>
<td>$ <input type="text" name="USDPrice" value="'.stripslashes($val['USDPrice']).'" size="10" class="inputtext"> USD</td>
</tr>
<tr>
<td valign="top"><strong>Short Description</strong></td>
<td><textarea name="ShortDesc" cols="40" rows="5" class="inputtext">'.stripslashes($val['ShortDesc']).'</textarea></td>
</tr>
<tr>
<td valign="top"><strong>Long Description</strong></td>
<td><textarea name="LongDesc" cols="40" rows="10" class="inputtext">'.stripslashes($val['LongDesc']).'</textarea></td>
</tr>
<tr>
<td valign="top"><strong>Is it a product from<br />
RegNow?</strong></td>
<td>
<input name="notrn" type="radio" value="0" ';
if($val['notrn'] == 0) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'Yes<br>
<input name="notrn" type="radio" value="1" ';
if($val['notrn'] == 1) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'No<br>
</td>
</tr>
<tr>
<td><strong>Download Link</strong></td>
<td><input type="text" name="TrialURL" value="'.stripslashes($val['TrialURL']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Buy Link</strong></td>
<td><input type="text" name="DirectPurchaseURL" value="'.stripslashes($val['DirectPurchaseURL']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Boxshot URL</strong></td>
<td><input type="text" name="Boxshot" value="'.stripslashes($val['Boxshot']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Screenshot URL</strong></td>
<td><input type="text" name="Screenshot" value="'.stripslashes($val['Screenshot']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>RegNow Vendor ID</strong></td>
<td><input type="text" name="VendorID" value="'.stripslashes($val['VendorID']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Vendor Name</strong></td>
<td><input type="text" name="VendorName" value="'.stripslashes($val['VendorName']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Vendor URL</strong></td>
<td><input type="text" name="VendorHomepageURL" value="'.stripslashes($val['VendorHomepageURL']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td valign="top"><strong>Status</strong></td>
<td>
<input name="status" type="radio" value="0" ';
if($val['status'] == 0) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'Normal<br>
<input type="radio" name="status" value="1" ';
if($val['status'] == 1) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'Featured<br>
<input type="radio" name="status" value="2" ';
if($val['status'] == 2) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'Bestseller </td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit" class="inputbutton"></td>
<td> </td>
</tr>
</table>
</form>
';
return $ret;
}
?>
...................................................................................................
sql dosyasida budur
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
--
-- Table structure for table `usb`
--
CREATE TABLE `ura_searches` (
`id` int(5) NOT lisanssız auto_increment,
`string` varchar(255) NOT lisanssız default '',
`hits` int(5) NOT lisanssız default '1',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `usb`
--
................................................................................................
arkadaslar simdi ben bunda son arananlari listelemek isdiyorum mesela
aranan kelime sigara siteadi.com/arama/sigara.html
seklinde bir kod yapip index e yerlestirmek isdiyorum bu gibi birsey yapabilirmiyim acaba
yardimci olabilecek arkadas varmi acaba ins istenilen bilgileri yazmisimdir.
simdiden ilgili arkadaslara tsk ederim.
..............................................................................................
<?php
include('header.php');
include('admin-functions.php');
$act = $_GET['do'];
switch($act){
default:
case 'default':
echo "<h2>Search statistics</h2>";
$sql = "SELECT COUNT(*) AS count FROM `ura_searches";
$result = mysql_query($sql);
if( !$result )
die(mysql_error());
$row = mysql_fetch_assoc($result);
$totals = $row['count'];
$sql = "SELECT * FROM `ura_searches` WHERE string != '' ORDER BY `hits` DESC LIMIT 15";
$result = mysql_query($sql);
if( !$result )
die(mysql_error());
echo "<div>";
echo "<p>There are ".$totals." unique keywords.</p>";
while( $row = mysql_fetch_assoc($result) ) {
echo "<h4>'".$row['string']."'</h4>Searched ".$row['hits']." time(s).<br /><br />";
}
if( $totals > 25 ) {
echo "<p><a href=\"stats.php?do=searches\">Show me the rest »</a></p>";
}
echo "</div>";
break;
case 'searches' :
$sql = "SELECT * FROM `ura_searches` ORDER BY `hits` DESC LIMIT 50";
$result = mysql_query($sql);
$totals = mysql_num_rows($result);
if( !$result )
die(mysql_error());
echo "<div>";
echo "<p>There are ".$totals." unique keywords.</p>";
while( $row = mysql_fetch_assoc($result) ) {
echo "<h4>'".$row['string']."'</h4>Searched ".$row['hits']." time(s).<br /><br />";
}
break;
}
include('footer.php');
?>
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
admin funcistion dosyasida bu
.............................................................................................
<?php
//settings.php functions
function validate_email($email) {
return eregi("^[a-z0-9]+[a-z0-9_.-]*@[a-z0-9]+[a-z0-9_.-]*\.[a-z]{2,4}$",$email);
}
function edit_profile_form($method = "post", $action = "settings.php?do=edit", $username, $email, $message){
if( isset($message) ) {
$ret = $message."<br />";
}
else $ret = "";
$ret .= "<form name=\"edit-profile\" method=\"".$method."\" action=\"".$action."\">";
$ret .= " <label><strong>Username</strong>:<br>";
$ret .= " <input type=\"text\" name=\"user\" value=\"".$username."\" class=\"inputtext\" /><br />";
$ret .= " </label><label>";
$ret .= " <strong>Your current password</strong>:<br>";
$ret .= " <input type=\"password\" name=\"current\" class=\"inputtext\"/><span style=\"font-size: 10px; color: #999;\">* Enter your current password should you change anything.</span><br>";
$ret .= " </label><label>";
$ret .= " <strong>New Password</strong>:<br>";
$ret .= " <input type=\"text\" name=\"newpass\" class=\"inputtext\"/><span style=\"font-size: 10px; color: #999;\">* Leave blank if you don't want to change your password.</span>";
$ret .= " </label><br />";
$ret .= " <label><strong>E-mail</strong>:<br>";
$ret .= " <input type=\"text\" name=\"email\" value=\"".$email."\" class=\"inputtext\" />";
$ret .= " </label>";
$ret .= " <br />";
$ret .= " <label>";
$ret .= " <input type=\"submit\" name=\"Submit\" value=\"Submit\" class=\"inputbutton\" />";
$ret .= " </label>";
$ret .= " </form>";
return $ret;
}
//--------------------------
//ads.php functions
function edit_ad_form($method = "post", $action = "ads.php?do=add", $title, $html, $message){
if(isset($message))
$ret = $message."<br />";
else $ret = "";
$ret .= "<div id=\"error_msg\">It's important that you don't leave any blank fields! After submitting this form your AD will instantly appear on your website.</div>";
$ret .= "<form method=\"".$method."\" action=\"".$action."\">";
$ret .=" <strong>Ad Title:</strong> <br> <input type=\"text\" name=\"title\" value=\"".$title."\" class=\"inputtext\" /><br />";
$ret .=" <strong>HTML Code:</strong> <br> The maximum ad size is: 300 x 250 <br> <textarea name=\"html\" class=\"inputtext\" cols=\"80\" rows=\"10\" >".$html."</textarea><br />";
$ret .=" <input name=\"Submit\" type=\"submit\" value=\"Save\" class=\"inputbutton\" /><br />";
$ret .=" </form>";
return $ret;
}
//------------------------
//login.php functions
function login_form($username, $error = ""){
echo'<div id="login_screen">
<div class="login_form">
'.$error.'
<form action="login.php" method="post" name="login-form">
Username: <br><input name="user" type="text" size="50" value="'.$username.'"/><br />
Password: <br><input name="pass" size="50" type="password" /><br />
<input type="submit" class="submit" value="Login" name="Submit" /><br />
<a href="forgot.php">Did you forget your password ?</a>
</form>
</div>
</div>';
}
function rand_pass($length = 5)
{
$smallcaps = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
$caps = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
$nums = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$keyVals = array();
$key = array();
$keyVals = array_merge($smallcaps, $caps, $nums);
for($i = 0; $i < $length; $i++)
{
$r = rand(0,count($keyVals)-1);
$key[$i] = $keyVals[$r];
}
return implode("", $key);
}
//-----------------------
//manager.php functions
function edit_form($mode, $action = "manager.php", $val = array(), $message){
$ret = '';
if( isset($message) ) {
$ret .=$message."<br />";
}
$ret .= '
<form name="manage-item" method="post" action="'.$action.'">
<table width="75%" border="0" cellpadding="4" cellspacing="0">';
if(strtolower($mode) == 'add') {
$ret .= '
<tr>
<td><strong>Product ID</strong></td>
<td><input type="text" name="ProductID" value="'.stripslashes($val['ProductID']).'" size="40" class="inputtext"></td>
</tr>
';
}
$ret .= '
<tr>
<td><strong>Product Name</strong></td>
<td><input type="text" name="ProductName" value="'.stripslashes($val['ProductName']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Category</strong></td>';
$result = @mysql_query("SELECT * FROM `ura_category`");
if( !result )
die(mysql_error());
$ret .= '<td><select name="CategoryID" size="1" class="inputtext">';
while( $row = mysql_fetch_assoc($result) ) {
if($val['CategoryID'] == $row['catid'] ) {
$ret .= '<option value="'.$row['catid'].'" selected>'.$row['name'].'</option>';
}
else
$ret .= '<option value="'.$row['catid'].'">'.$row['name'].'</option>';
}
$ret .= '</select></td>';
$ret .= '
</tr>
<tr>
<td><strong>Price</strong><br /><span style="font-size: 10px">(Enter numerical value only)</span></td>
<td>$ <input type="text" name="USDPrice" value="'.stripslashes($val['USDPrice']).'" size="10" class="inputtext"> USD</td>
</tr>
<tr>
<td valign="top"><strong>Short Description</strong></td>
<td><textarea name="ShortDesc" cols="40" rows="5" class="inputtext">'.stripslashes($val['ShortDesc']).'</textarea></td>
</tr>
<tr>
<td valign="top"><strong>Long Description</strong></td>
<td><textarea name="LongDesc" cols="40" rows="10" class="inputtext">'.stripslashes($val['LongDesc']).'</textarea></td>
</tr>
<tr>
<td valign="top"><strong>Is it a product from<br />
RegNow?</strong></td>
<td>
<input name="notrn" type="radio" value="0" ';
if($val['notrn'] == 0) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'Yes<br>
<input name="notrn" type="radio" value="1" ';
if($val['notrn'] == 1) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'No<br>
</td>
</tr>
<tr>
<td><strong>Download Link</strong></td>
<td><input type="text" name="TrialURL" value="'.stripslashes($val['TrialURL']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Buy Link</strong></td>
<td><input type="text" name="DirectPurchaseURL" value="'.stripslashes($val['DirectPurchaseURL']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Boxshot URL</strong></td>
<td><input type="text" name="Boxshot" value="'.stripslashes($val['Boxshot']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Screenshot URL</strong></td>
<td><input type="text" name="Screenshot" value="'.stripslashes($val['Screenshot']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>RegNow Vendor ID</strong></td>
<td><input type="text" name="VendorID" value="'.stripslashes($val['VendorID']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Vendor Name</strong></td>
<td><input type="text" name="VendorName" value="'.stripslashes($val['VendorName']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td><strong>Vendor URL</strong></td>
<td><input type="text" name="VendorHomepageURL" value="'.stripslashes($val['VendorHomepageURL']).'" size="40" class="inputtext"></td>
</tr>
<tr>
<td valign="top"><strong>Status</strong></td>
<td>
<input name="status" type="radio" value="0" ';
if($val['status'] == 0) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'Normal<br>
<input type="radio" name="status" value="1" ';
if($val['status'] == 1) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'Featured<br>
<input type="radio" name="status" value="2" ';
if($val['status'] == 2) $ret .= 'checked >'; else $ret .= '>';
$ret .= 'Bestseller </td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit" class="inputbutton"></td>
<td> </td>
</tr>
</table>
</form>
';
return $ret;
}
?>
...................................................................................................
sql dosyasida budur
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
--
-- Table structure for table `usb`
--
CREATE TABLE `ura_searches` (
`id` int(5) NOT lisanssız auto_increment,
`string` varchar(255) NOT lisanssız default '',
`hits` int(5) NOT lisanssız default '1',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `usb`
--
................................................................................................
arkadaslar simdi ben bunda son arananlari listelemek isdiyorum mesela
aranan kelime sigara siteadi.com/arama/sigara.html
seklinde bir kod yapip index e yerlestirmek isdiyorum bu gibi birsey yapabilirmiyim acaba
yardimci olabilecek arkadas varmi acaba ins istenilen bilgileri yazmisimdir.
simdiden ilgili arkadaslara tsk ederim.