View file Ad4fun.com/serve/banner.php

File size: 4.98Kb
<?php

session_start();

if(!$_SESSION['pid'] || !$_SESSION['username'])

{ header('Location: ./login.php'); exit(); }

if(!$_POST['submit']) {

 print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

?>

<!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>Create Text Ad Campaign</b></div>

<div class='hello'>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><div class='form'>

<form 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='http://' size='30' maxlength='50' id='url' class='tbox' /><br/>

<br/>[Optional field] <br/><br/>

Title (15-35 Chars) :<br>

<input name='title' type='text' size='35' maxlength='35' id='title' class='tbox' />

<br/>

Adult Site ? <input name='adult' type='checkbox' value='1' />

<br/><input type='submit' value='Create Ad' name='submit' class='button' />

</form>

</div>

<div class='ads'>* file should be image and file size limit is 7 KB</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';

$sql="select aid from aid where pid='".$_SESSION['pid']."'";

if($result=$mysqli->query($sql)){

  if ($result->num_rows > 4) exit("you already have 5 ad compaign and so u cannot create more than this limit <br /><a href=\"javascript:history.back()\">Go Back</a>");

}

$f=microtime().rand(0,9999).uniqid();

$f=md5($f).'.jpg';

if(filesize($_FILES['image']['tmp_name']) > (7*1024)  ||  filesize($_FILES['image']['tmp_name'])==0) exit('File size is more than 7 KB or Filesize is 0 kb'."<br /><a href=\"javascript:history.back()\">Go Back</a>");

#starting session

@session_start();

move_uploaded_file($_FILES['image']['tmp_name'],"image/$f");

$sql="insert into aid (pid,title,url,img,adult,status,log_time,run,pid1) values('".$_SESSION['pid']."','$title','$url','$f','$adult','1','".date("g:ia,j-m,Y ")."','1','".$_SESSION['pid']."')";

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>Create new 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 Added your compaign</div>

<div class="registered">Please note: that we will take 1 hour to show your ad on our adnetwork</div>

<?php include'footer.php' ?>

</div>

</body></html>

<?php

} else {

  echo 'problem in database please contact administrator';

}

}

?>