<?php
session_start();
if(!$_SESSION['pid'] || !$_SESSION['username'])
{ header('Location: ./login.php'); exit(); }
include'config.php';
$id=$_GET['id'];
$pid=$_SESSION['pid'];
$sql="select * from aid where pid='$pid' and aid='$id' limit 1";
$result=$mysqli->query($sql);
function ad(){
global $result;
if($result->num_rows>0){
while($row=$result->fetch_array()){
$total['title']=$row['title'];
$total['url']=$row['url'];
$total['adult']=$row['adult'];
$total['img']=$row['img'];
}
} else{
return 0;
}
return $total;
}
$ad=ad();
if($ad==0) exit('No compaign exit');
if($ad['img']==''){
if(!$_POST['submit']) {
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="pragma" content="no-cache" />
<meta name="keywords" content="mobile advertising, mobile ads, mobile advertising company, advertising campaign, free traffic, free advertising">
<meta name="description" content=", provides you to advertise your wapsite for free.. Site owners can advertise their sites at affordable costs. And that cost is nothing. You just share your users with other site owners who in return provide you their visitors. .">
<title>Ad Campaigns</title>
<link rel="stylesheet" href="style.css" type="text/css" media="handheld,screen"/>
</head><body id='top'>
<div class='main'>
<div class='head'>Ad Campaigns<br />
<b>Edit Text Ad Campaign</b></div>
Hello ,<font color=red><b><?php echo $_SESSION['username']?></b></font> | <a href='logout.php'>Logout</a>
<div class='bookmark'>You Can Use %phn% to show phone model</div><div class='hello'></div><div class='form'>
<form action="<?php echo basename(__FILE__).'?id='.$_GET['id']?>" method='post'>
Title (35 Chars):<br>
<input name='title' type='text' value='<?php echo $ad["title"] ?>' size='35' maxlength='35' id='title' class='tbox' />
<br>
Link Url:<br>
<input name='url' type='text' value='<?php echo $ad["url"] ?>' size='35' maxlength='50' id='url' class='tbox' />
<input name='adult' type='checkbox' value='<?php echo $ad["adult"] ?>' /> Adult Site ?
<br/>
<input type='submit' value='Edit Ad' name='submit' class='button' />
</form>
</div>
<div class='dashlink'><a href='managesite.php'>Created Ads</a></div>
<?php include'footer.php' ?>
</div>
</body></html>
<?php
} else{
#verifing data
$title=$_POST['title'];
if(strlen($title)>35) exit("Title should not contain more than 35 character <br /> <a href=\"javascript:history.back()\">Go Back</a>");
if(strlen($title)<15) exit("Title should contain atleast 15 character <br /> <a href=\"javascript:history.back()\">Go Back</a>");
$url=$_POST['url'];
$adult=$_POST['adult'];
#### checking for adult ##
$badword="sex fuck ass rape pussy desi scandal xxx porn"; #separated by space
$badword=explode(' ',$badword);
if($adult==false){
foreach($badword as $v){
if(stristr($title,$v)) $adult=true;
}
}
#### End Of checking ###
if(!stristr($url,'http://')) exit(" url is invalid <br /> <a href=\"javascript:history.back()\">Go Back</a>");
@session_start();
#connecting to mysql
include'config.php';
$sql="update aid set pid='$pid', title='$title', url='$url', adult='$adult', log_time='".date("g:ia,j-m,Y ")."' where aid='".$_GET['id']."'";
if($mysqli->query($sql)===true){
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="pragma" content="no-cache" />
<meta name="keywords" content="mobile advertising, mobile ads, mobile advertising company, advertising campaign, free traffic, free advertising">
<meta name="description" content=", provides you to advertise your wapsite for free.. Site owners can advertise their sites at affordable costs. And that cost is nothing. You just share your users with other site owners who in return provide you their visitors. .">
<title>Edit campaign</title>
<link rel="stylesheet" href="style.css" type="text/css" media="handheld,screen"/>
</head><body id='top'>
<div class=main>
<div class="userarea">ad4fun.com</div>
<div class="registered">Successfully edited your compaign</div>
<?php include'footer.php' ?>
</div>
</body></html>
<?php
} else {
echo 'problem in database please contact administrator';
}
}
} else {
if(!$_POST['submit']) {
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="pragma" content="no-cache" />
<meta name="keywords" content="mobile advertising, mobile ads, mobile advertising company, advertising campaign, free traffic, free advertising">
<meta name="description" content=", provides you to advertise your wapsite for free.. Site owners can advertise their sites at affordable costs. And that cost is nothing. You just share your users with other site owners who in return provide you their visitors. .">
<title>Ad Campaigns</title>
<link rel="stylesheet" href="style.css" type="text/css" media="handheld,screen"/>
</head><body id='top'>
<div class='main'>
<div class='head'>Ad Campaigns<br />
<b>Edit Banner Ad Campaign</b></div>
<div class='bookmark'>You Can Use %phn% to show phone model</div><div class='hello'>Hello ,<font color=red><b><?php echo $_SESSION['username']?></b></font> | <a href='../../logout/'>Logout</a></div><div class='form'>
<form action="<?php echo basename(__FILE__).'?id='.$_GET['id']?>" enctype='multipart/form-data' method='POST' name='form'>
Banner :<br/><input type='file' name='image'><br>
Link Url:<br>
<input name='url' type='text' value='<?php echo $ad["url"] ?>' size='30' maxlength='50' id='url' class='tbox' /><br/>
<br/>[Optional field] <br/><br/>
Title (15-35 Chars) :<br>
<input name='title' type='text' value="<?php echo $ad["title"] ?>" size='35' maxlength='35' id='title' class='tbox' />
<br/>
Adult Site ? <input name='adult' type='checkbox' value='1' />
<br/><input type='submit' value='Edit Ad' name='submit' class='button' />
</form>
</div>
<div class='dashlink'><a href='managesite.php'>Created Ads</a></div>
<?php include'footer.php' ?>
</div>
</body></html>
<?php
} else{
#verifing data
$title=$_POST['title'];
if(strlen($title)>35) exit("Title should not contain more than 35 character <br /> <a href=\"javascript:history.back()\">Go Back</a>");
if(strlen($title)<15) exit("Title should contain atleast 15 character <br /> <a href=\"javascript:history.back()\">Go Back</a>");
$url=$_POST['url'];
$adult=$_POST['adult'];
#### checking for adult ##
$badword="sex fuck ass rape pussy desi scandal xxx porn"; #separated by space
$badword=explode(' ',$badword);
if($adult==false){
foreach($badword as $v){
if(stristr($title,$v)) $adult=true;
}
}
#### End Of checking ###
if(!stristr($url,'http://')) exit(" url is invalid <br /> <a href=\"javascript:history.back()\">Go Back</a>");
#connecting to mysql
include'config.php';
$f=microtime().rand(0,9999).uniqid();
$f=md5($f).'.jpg';
if(filesize($_FILES['image']['tmp_name']) > (7*1024)) exit('File size is more than 7 KB'."<br /><a href=\"javascript:history.back()\">Go Back</a>");
#starting session
@session_start();
move_uploaded_file($_FILES['image']['tmp_name'],"image/$f");
$sql="update aid set pid='$pid', title='$title', url='$url', img='$f', adult='$adult', log_time='".date("g:ia,j-m,Y ")."' where aid='".$_GET['id']."'";
if($mysqli->query($sql)===true){
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="pragma" content="no-cache" />
<meta name="keywords" content="mobile advertising, mobile ads, mobile advertising company, advertising campaign, free traffic, free advertising">
<meta name="description" content=", provides you to advertise your wapsite for free.. Site owners can advertise their sites at affordable costs. And that cost is nothing. You just share your users with other site owners who in return provide you their visitors. .">
<title>Edit Banner Ad Campaign</title>
<link rel="stylesheet" href="style.css" type="text/css" media="handheld,screen"/>
</head><body id='top'>
<div class=main>
<div class="userarea">ad4fun.com</div>
<div class="registered">Successfully Edited your compaign</div>
<?php include'footer.php' ?>
</div>
</body></html>
<?php
} else {
echo 'problem in database please contact administrator';
}
}
}
?>