Location: PHPKode > projects > Free PHP Ad Rotator Banner > HBR_1_3/admin/delban.php
<?php
@session_start();
?>
<!-- Welcome to the scripts database of HIOX INDIA      -->
<!-- This tool is developed and a copyright             -->
<!-- product of HIOX INDIA.				        -->
<!-- For more information visit http://www.hscripts.com -->

<html>
<head>
</head>

<?php 
include "authheader.php";
if($block != "true")
{   
include "heade.php" 
?>

<!-- content row -->
<table width=95% algin=center border=1 cellpadding=0 cellspacing=0 bgcolor=ccabba>
<tr height=100%>
<td height=100% class=maintext align=center>

<?php

$asd = $_POST['addd'];

if($asd == "del")
{
$deln = $_POST['dname'];

	if($deln == "")
	{
		echo "<font color=red>Empty Values Not deleted</font><br><br>";
	}
	else
	{
		// del ad code here
		$file = "./images.php";
		$lines = file($file);
		$i=0; $str=""; $mm=false;

		foreach ($lines as $line_num => $line)
		{

				$firstPos = strpos($line,'mage="');
				
				if($firstPos != 0 || $firstPos != null)
				{
				  if($i == $deln){ $mm=true; }
				  else{ $str  = $str.$line; }
				  $i = $i+1;
				}
				else
				{
					if( $mm === true ){ $mm=false;}
					else{
					$str  = $str.$line;
					}
				}
		}
		//echo "$str";

		$open = fopen("images.php", "w");
		fwrite($open, $str);
		fclose($open);
		// del ad code here

		echo "<font color=red><b>Banner Successfully Deleted</b></font><br><br>";
	}

}
?>

Use this form to delete old banners.<br>
<table class=maintext bgcolor=acbefa>
<?php

$file = "./images.php";

$lines = file($file);
$count = count($lines);

$i=0; $url=false;

foreach ($lines as $line_num => $line)
{
	if($url === false)
	{
		$firstPos = strpos($line,'"');
		$secPos = strpos($line,'"',($firstPos+1));
		
		if($firstPos != 0 || $firstPos != null)
		{
			$img[$i] = substr($line,$firstPos+1,($secPos-$firstPos)-1);
			$imh = $img[$i];
			echo "<tr><td bgcolor=#dadaef style=\"color:000000; border: 2px ridge green;\">";
			echo "<form name=addf action=\"$PHP_SELF\" method=POST>";
			echo "<input name=addd type=hidden value=del>";
			echo "<input name=dname type=hidden value=\"$i\">";
			echo $img[$i]."<br>";
		
			$url=true;
		}
	}
	else
	{
		$firstPos = strpos($line,'"');
		$secPos = strpos($line,'"',($firstPos+1));
		$lnk[$i] = substr($line,$firstPos+1,($secPos-$firstPos)-1);
		$lin = $lnk[$i];
		//print "linkAr.push(\"$lin\" );";
		echo $lnk[$i]."</td>";
		echo "<td><input type=submit value=delete></form></td></tr>";
		$url = false;

		$i=$i+1;
	}
}
?>
</table>


</td>
</tr>
</table>

</td></tr>
<!-- content row -->

</table>
<!-- main table -->

</td></tr>
</table>
<?php
}
?>
</body>
</html>

<!-- Welcome to the scripts database of HIOX INDIA      -->
<!-- This tool is developed and a copyright             -->
<!-- product of HIOX INDIA.				        -->
<!-- For more information visit http://www.hscripts.com -->
Return current item: Free PHP Ad Rotator Banner