File size: 1.02Kb
<?php
include('../includes/connect.php');
include('../includes/lang2.php');
if(!$userid) go($url);
$queryAds = mysql_query("SELECT adsid,type FROM users WHERE id = '$userid'") or die ( mysql_error());
$info = mysql_fetch_assoc($queryAds);
mysql_free_result($queryUser);
if($rights>0) {
//edit ads
if(isset($_GET['ads'])){
$title = $lang["changeads"];
include('../includes/header.php');
echo '<div class="title">'.$lang["changeads"].'</div>';
if(isset($_POST['change'])){
$old = input($_POST['old']);
$new = input($_POST['new']);
$type = input($_POST['type']);
if($old==''|| $new=='') {
echo '<div class="news">Please insert your Ads ID!<br>
<a href="javascript:history.go(-1)">'.$lang["back"].'</a></div>';
}
elseif($type=='') {
echo '<div class="news">Please choose your Ads type!<br>
<a href="javascript:history.go(-1)">'.$lang["back"].'</a></div>';
}
else {
mysql_query("UPDATE settings SET ads = '$new', type = '$type' WHERE adsid = '$adsid'");
echo '<div class="menu">Your ads succesfully updated!</div>';
}
}