Location: PHPKode > scripts > PHP Reciprocial Links > php-reciprocial-links/include_categories.php
<?php
///////////////////////////////////////////////////////////////////////////////
///      THE CODE OF THIS SCRIPT HAS BEEN DEVELOPED BY SOFTBIZ SOLUTIONS  /////
///      AND IS MEANT TO BE USED ON THIS SITE ONLY AND IS NOT FOR RESALE   /////
///      OR REDISTRIBUTION.                                               ///// 
///      IF YOU SEE ANY VIOLATION OF ABOVE PLEASE REPORT AT:              /////
///      hide@address.com                                        /////
///      http://www.softbizscripts.com                                    /////
///      http://www.softbizsolutions.com                                  /////  
///////////////////////////////////////////////////////////////////////////////
include_once("myconnect.php");
$thispage=$_SERVER['PHP_SELF'];
$strpass="";

$time_limit=3600;
set_time_limit($time_limit);

if ( isset($_REQUEST["cid"] ) )
{
$strpass=$strpass . "&cid=" . $_REQUEST["cid"];
}

//// If some special variables were passed ////	
if ( isset($_REQUEST["sbreciprocalfnx"]) )
{
//////////DISPLAY ADD LINK FORM ///

switch ($_REQUEST["sbreciprocalfnx"])
{
case "addlink":
?>
<?
$link="";
$email="";
$title="";
$reciprocallink="";
$description="";
$cid="";

if ( isset($_REQUEST["link"] ) )
{
$link=$_REQUEST["link"];
}
if ( isset($_REQUEST["email"] ) )
{
$email=$_REQUEST["email"];
}
if ( isset($_REQUEST["title"] ) )
{
$title=$_REQUEST["title"];
}

if ( isset($_REQUEST["reciprocallink"] ) )
{
$reciprocallink=$_REQUEST["reciprocallink"];
}

if ( isset($_REQUEST["description"] ) )
{
$description=$_REQUEST["description"];
}

if ( isset($_REQUEST["cid"] ) )
{
$cid=$_REQUEST["cid"];
}
?> <script language="JavaScript">
function category(box)
{
str="choosecategory.php?box="  + box;

window.open(str,"Category","top=5,left=30,toolbars=no,maximize=yes,resize=yes,width=550,height=450,location=no,directories=no,scrollbars=yes");
}

function emailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
	alert("Email address seems incorrect (check @ and .'s)")
	return false
}
var user=matchArray[1]
var domain=matchArray[2]
if (user.match(userPat)==null) {
    alert("The username doesn't seem to be valid.")
    return false
}
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert("Destination IP address is invalid!")
		return false
	    }
    }
    return true
}
var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert("The domain name doesn't seem to be valid.")
    return false
}
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   alert("The address must end in a three-letter domain, or two letter country.")
   return false
}
if (len<2) {
   var errStr="This address is missing a hostname!"
   alert(errStr)
   return false
}
return true;
}

function Validate()
{

if (form123.email.value=='')
{
	alert("Email cannot be left blank");
	document.form123.email.focus();
	return (false);
}

if (!emailCheck (form123.email.value) )
{
   	document.form123.email.focus();
	return (false);
}


if (form123.title.value=='')
{
	alert("Web Site title cannot be left blank");
	document.form123.title.focus();
	return (false);
}

if (form123.link.value=='')
{
	alert("Site Link cannot be left blank");
	document.form123.link.focus();
	return (false);
}
if (form123.reciprocallink.value=='')
{
	alert("Reciprocal Link cannot be left blank");
	document.form123.reciprocallink.focus();
	return (false);
}
if (form123.description.value=='')
{
	alert("Description cannot be left blank");
	document.form123.description.focus();
	return (false);
}



return(true);
}

//-->
</script>
<form action="<?php echo $thispage ;?>" method="post" name="form123" id="form123" onsubmit="return Validate();">
  <table width="640" border="0" cellspacing="10" cellpadding="0">
    <tr bgcolor="#990000"> 
      <td height="25" colspan="2"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">&nbsp;<strong>Add 
        Your Link</strong></font></td>
    </tr>
    <tr> 
      <td valign="top" bgcolor="#f5f5f5"><b><font size="2" face="Arial, Helvetica, sans-serif"> 
        <?php
$rs_query=mysql_query("Select * from reciprocal_config " );
$rs_a=mysql_fetch_array($rs_query); 
?>
        Reciprocal Link :</font></b></td>
      <td width="479"><p><font size="2" face="Arial, Helvetica, sans-serif">http:// 
          <input name="reciprocallink" type="text" id="reciprocallink" value="<? echo $reciprocallink; ?>" size="35" border="0">
          <br>
          (Please enter the URL of the page where you placed link to our site. 
          <font color="#FF0000">Please ensure that link to our site is there before 
          you submit this form. Otherwise your request will not be entertained.</font>)<br>
          Our Link Should have following information:<br>
          <strong>Title:</strong> <? echo $rs_a["title"]; ?><br>
          <strong>Url:</strong> &nbsp;http://www.<? echo $rs_a["reciprocal_link"]; ?><br>
          <strong>Description:</strong> <? echo $rs_a["description"]; ?></font></p>
        <p><font color="#990000" size="2" face="Arial, Helvetica, sans-serif"><strong>Note: 
          </strong></font><font size="2" face="Arial, Helvetica, sans-serif">Our 
          cron machine performs a check on reciprocial links each week, and purge's 
          the links to websites which don't have backlink to our website.</font></p></td>
    </tr>
    <tr> 
      <td width="131" bgcolor="#f5f5f5"><b><font size="2" face="Arial, Helvetica, sans-serif">Your 
        Web Site Title:</font></b></td>
      <td> <input name="title" type="text" value="<? echo $title; ?>" size="35" border="0"> 
        <input type="hidden" name="sbreciprocalfnx" value="updatelink"> </td>
    </tr>
    <tr> 
      <td bgcolor="#f5f5f5"><b><font size="2" face="Arial, Helvetica, sans-serif">Your 
        Email :</font></b></td>
      <td><input name="email" type="text" id="email" value="<? echo $email; ?>" size="35" border="0"></td>
    </tr>
    <tr> 
      <td bgcolor="#f5f5f5"><b><font size="2" face="Arial, Helvetica, sans-serif">Your 
        Website URL:</font></b></td>
      <td> <font size="2" face="Arial, Helvetica, sans-serif">http:// 
        <input name="link" type="text" id="link" value="<? echo $link; ?>" size="35" border="0">
        </font> </td>
    </tr>
    <tr> 
      <td bgcolor="#f5f5f5"><b><font size="2" face="Arial, Helvetica, sans-serif">Category:</font></b></td>
      <td><font face="Arial, Helvetica, sans-serif" size="2"> 
        <select name="cid" id="cid" >
          <?
				  $rs_query=mysql_query("select * from sbreciprocal_cats order by pid");
				  
				  while($rst=mysql_fetch_array($rs_query))
				  {
				  $cat_path="";
		$child=mysql_fetch_array(mysql_query("select * from sbreciprocal_cats where pid=".$rst["id"]));
									  if($child)
									  {
									  continue;
									  }
									  $cat_path.=$rst["catname"];
		 $par=mysql_query("select * from sbreciprocal_cats where id=".$rst["pid"]);
		 				while($parent=mysql_fetch_array($par))
		 				{
						$cat_path=$parent["catname"].">".$cat_path;
						$par=mysql_query("select * from sbreciprocal_cats where id=".$parent["pid"]);
						}
                                      ?>
          <option value="<? echo $rst["id"];?>" ><? echo $cat_path;?></option>
          <?
									  }
									  ?>
        </select>
        </font></td>
    </tr>
    <tr> 
      <td bgcolor="#f5f5f5"><b><font size="2" face="Arial, Helvetica, sans-serif">Your 
        Web Site Description (keywords):</font></b></td>
      <td> <textarea name="description" cols="35" rows="5" border="0"><? echo $description; ?></textarea></td>
    </tr>
    <tr> 
      <td colspan="2"> <div align="center"> 
          <input type="submit" name="submitButtonName" value="Add Link" border="0">
          <br>
        </div></td>
    </tr>
  </table>
</form>
<?
break; //Display add form code
/////////////////////////////////
case "updatelink":

////////////////////////////////   ADDING LINK TO THE DATABASE /////////////////////
$link="";
$title="";
$reciprocallink="";
$description="";
$cid="";

if ( isset($_REQUEST["link"] ) )
{
$link=$_REQUEST["link"];
}
if ( isset($_REQUEST["title"] ) )
{
$title=$_REQUEST["title"];
}

if ( isset($_REQUEST["reciprocallink"] ) )
{
$reciprocallink=$_REQUEST["reciprocallink"];
}

if ( isset($_REQUEST["description"] ) )
{
$description=$_REQUEST["description"];
}

if ( isset($_REQUEST["cid"] ) )
{
$cid=$_REQUEST["cid"];
}

////////////////// Check LINK Presense ////////////////

$ok="no";

// Read Configuration
$rs_query=mysql_query("Select * from reciprocal_config " );
$rs=mysql_fetch_array($rs_query);
$sitename=$rs["reciprocal_link"];
// Get link Info
$url=$_REQUEST["reciprocallink"];
/// Add http if needed ///
if ( !ereg ("(http://)", $url) ) 
{
$url="http://" . $url;
}
////////////////////////////
//$fp = @fopen($url,"r");

$page = implode ('', file ($url));
//<textarea>
//  echo $page; </textarea>

if ($page)
{ 
//$page="";
//$page= file_get_contents ($fp, 40000);
//$fcontents = file ($url);
//if ( ereg ("< *[a|A] +.*[h|H][r|R][e|E][f|F] *= *['|\"] *(http://)?(www.)?($sitename).*", $page) ) 

if ( ereg ("< *[a|A] +.*[h|H][r|R][e|E][f|F] *=.*(http://)?(www.)?($sitename).*", $page) ) 
{
$ok="yes";
} 
else
{
$ok="no";
} 
}
else
{
$ok="no";
}
///////////////////Link detection  Done ////////////////////////////////

if ($ok=="no")
{
?>
<p align="center"><font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Sorry, 
  The page <font color="#0066FF"><?php echo $url?></font> does not contain link to <font color="#0066FF"><?php echo $sitename?></font> or the page was not found. </strong></font></p>
<table width="76%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>1. 
      Go back and check url you filled in the &quot;Reciprocal Link&quot; field.</strong></font></td>
  </tr>
  <tr>
    <td><font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>2. 
      Also ensure that the page on your website contains link to our web site.</strong></font></td>
  </tr>
</table>
<p align="center">&nbsp;</p>
<form>
  <div align="center"> 
    <input type="button" name="Submit" value="Back" onclick="javascript:window.history.go(-1);">
  </div>
</form>

<?
}
else
{
$rs0_query=mysql_query ("select * from reciprocal_links where link='" . $_POST["link"]. "'");
if ($rs0=mysql_fetch_array($rs0_query))
{
?>
<p><font color="#0066FF" size="2" face="Arial, Helvetica, sans-serif"><strong>Your 
  site has already been added. </strong></font></p>
<p>
  <?
}
else
{
//// Prepare query to execute "Insert link into db ////

if (!get_magic_quotes_gpc()) {
$description=str_replace('$', '\$',addslashes($_REQUEST["description"]));
$title=str_replace('$', '\$',addslashes($_REQUEST["title"]));
$email=str_replace('$', '\$',addslashes($_REQUEST["email"]));
$link=str_replace('$', '\$',addslashes($_REQUEST["link"]));
$reciprocallink=str_replace('$', '\$',addslashes($_REQUEST["reciprocallink"]));
}
else
{
$description=$_REQUEST["description"];
$title=$_REQUEST["title"];
$email=$_REQUEST["email"];
$link=$_REQUEST["link"];
$reciprocallink=$_REQUEST["reciprocallink"];
}

$sql1="insert into reciprocal_links (link,email,title,reciprocallink,cid,description,approved) Values(" .
" '$link',"  .
" '$email',"  .
"'$title',"  .
"'$reciprocallink',"  .
" " . str_replace("'","''",$_POST["cid"]) . ","  .
"'$description',"  .
"'no')";
mysql_query($sql1 );
$rs_t=mysql_fetch_array(mysql_query("select max(id) from reciprocal_links "));
$id=$rs_t[0];
/// Mail to administrator and the person who submitted ///////


////////////////////  SEND MAIL TO MEMBER/ bcc to admin ////////////////
//Gets member info
$rs0=mysql_fetch_array(mysql_query("select * from reciprocal_links where id=" . $id));

$rs1=mysql_fetch_array(mysql_query("select * from sbreciprocal_cats where id=" . $rs0["cid"]));
$category=$rs1["catname"];

//Reads email to be sent
$sql = "SELECT * FROM reciprocal_mails where id=1" ;
$rs_query=mysql_query($sql);



if ( $rs=mysql_fetch_array($rs_query)  )
  {
			 $from =$rs["fromid"];
			 $to = $rs0["email"];
			 $subject =$rs["subject"];
		     $header="From:" . $from . "\r\n" ."Reply-To:". $from  ;
		 	 $body=str_replace("<category>", $category,str_replace("<email>", $rs0["email"],str_replace("<url>",  $rs0["link"],str_replace("<reciprocallink>", $rs0["reciprocallink"],str_replace("<title>", $rs0["title"],str_replace("<urldescription>", $rs0["description"], $rs["mail"]) ))))) ; 
			 mail($to,$subject,$body,$header);

// Reads Site config//////////////////
$rs_query=mysql_query("Select * from reciprocal_config" );
$rs_a=mysql_fetch_array($rs_query);
$to1 = $rs_a["email"];
mail($to1,"cc:" . $subject,$body,$header);
//////////////////////////

  }
  
////////////////////////////////////////////////////////////


/////////////////////////////////////////////////

/////////////////  CODE TO DISPLAY PARTNER SITES /////////////
?>
<p><font color="#0066FF" size="2" face="Arial, Helvetica, sans-serif"><strong>Thanks 
  For Adding link to your site. </strong></font></p>
<p><font color="#0066FF" size="2" face="Arial, Helvetica, sans-serif">The link 
  will appear within 48 hours. </font></p>

<?
} //Added first time ends

  	$rs_query1=mysql_query("Select * from reciprocal_partnersites" );
	if ($rs1=mysql_fetch_array($rs_query1))
{
?>
<p> <font color="#0066FF" size="2" face="Arial, Helvetica, sans-serif">Please 
  also consider submitting your link to our other partner sites also. Submitting 
  you sites to maximum sites with help increase your search engine standing.</font></p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="4%"><div align="right"><font color="#0066FF" size="2" face="Arial, Helvetica, sans-serif"><strong>#&nbsp;</strong></font></div></td>
    <td width="59%"><font color="#0066FF" size="2" face="Arial, Helvetica, sans-serif"><strong>Website</strong></font></td>
    <td width="37%"><font color="#0066FF" size="2" face="Arial, Helvetica, sans-serif"><strong>Submit</strong></font></td>
  </tr>
  <?
  $cnt=0;
  	$rs_query=mysql_query("Select * from reciprocal_partnersites" );
	while ($rs=mysql_fetch_array($rs_query))
	{
	$cnt++;
 ?>
  <form action="http://<? echo $rs["link"]; ?>" method="get" target="_blank" >
    <tr> 
      <td><div align="right"><strong><font color="#333333" size="2" face="Arial, Helvetica, sans-serif"><? echo $cnt; ?>.&nbsp;</font></strong></div></td>
      <td height="35"><font color="#333333" size="2" face="Arial, Helvetica, sans-serif"><strong><? echo $rs["title"]; ?> 
        <input name="link" type="hidden" value="<? echo $link; ?>">
        <input name="title" type="hidden" value="<? echo $title; ?>">
        <input name="description" type="hidden" value="<? echo $description; ?>">
        <input name="reciprocallink" type="hidden" value="<? echo $reciprocallink; ?>">
        <input type="hidden" name="sbreciprocalfnx" value="addlink">
        </strong> </font></td>
      <td><font color="#333333" size="2" face="Arial, Helvetica, sans-serif"> 
        <input type="submit" name="submitButtonName" value="Submit" border="0">
        </font></td>
    </tr>
  </form>
  <?
}
?>
</table>
<p><font color="#0066FF" size="2" face="Arial, Helvetica, sans-serif"></font></p>
<?
}
?>
<p>&nbsp;</p>
<p><font color="#0066FF" size="2" face="Arial, Helvetica, sans-serif"><br>
  <a href="<?php echo $thispage ;?>">BACK</a> </font></p>
<?
////////// Partner Sites displayed ////////////////////////////////////////////////////  
////////////////////////////////////////////////////  THE LINK ADDED //////////////////
}


break; //Display add form code
}

} //If sbreciprocalfnx was NOT PASSED
else
{
/////////  THE CATEGORY DISPLAY PAGE FOLLOWS ///////////////////////
?>
<?
if ( isset( $_REQUEST["cid"] ) && $_REQUEST["cid"]!="" )
{
$cid=$_REQUEST["cid"];
}
else
{
$cid=0;
}
  	$rs_query=mysql_query("Select * from sbreciprocal_cats where id=" . $cid );
	if ($rs=mysql_fetch_array($rs_query))
	{
	$catname=$rs["catname"];
	$category=$rs["id"];
	$cid=$rs["id"];
	}
    else
	{
	$catname="";
	$category=0;
	$cid=0;
	}
 $catpath="";
  	$rs_query=mysql_query("Select * from sbreciprocal_cats where id=" . $category );
	while ($rs=mysql_fetch_array($rs_query))
    {
    $catpath =" > "  .$rs["catname"] . $catpath; 
  	$rs_query=mysql_query("Select * from sbreciprocal_cats where id=" . $rs["pid"] );
	 
	}
    
  ?>
<form action="choosecategory.php" method="post" name="frm123">
  <table width="600" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td><font size="2" face="Arial, Helvetica, sans-serif"><strong>&nbsp;</strong></font></td>
    </tr>
    <tr>
      <td bgcolor="#f5f5f5"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="<?php echo $thispage ;?>"> 
        All Categories</a></font> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo  $catpath; ?></font></td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
    </tr>
  </table>
  <font face="Arial, Helvetica, sans-serif" size="2"> 
  <?
  	$rs_query=mysql_query("Select count(*) from sbreciprocal_cats where pid=" . $cid );
	$rs=mysql_fetch_array($rs_query);
    $h= $rs[0];
	if ($h>10)
	{
	$h=10;
	}
	
  	$rs_query=mysql_query("Select * from sbreciprocal_cats where pid=" . $cid );
	if ($rs=mysql_fetch_array($rs_query))
	{
	
  ?>
  <table width="600" border="0" cellspacing="0" cellpadding="0">
    <?php
					   $cnt=1;
					   $rs_query_t=mysql_query("Select * from sbreciprocal_cats where pid=" . $cid . " order by catname"  	);
					   while($rs_t=mysql_fetch_array($rs_query_t))
					   {
					   ?>
    <?php if ($cnt%2==1) { ?>
    <tr> 
      <?php } ?>
      <td height="25"><font size="2" face="Arial, Helvetica, sans-serif"> <a href="<?php echo $rs_t["id"] ;?>.htm"><?php echo $rs_t["catname"] ;?></a> 
        <font size="1">( 
        
		
		
		
		<?php
			
					$child_list=$rs_t["id"];
			        $child_query=mysql_query("select * from sbreciprocal_cats where pid=".$rs_t["id"]);
					while($child=mysql_fetch_array($child_query))
					{
					$child_list.=",".$child["id"];					
  					$thislist="-1," . $child["id"];
				    while ($child=mysql_fetch_array($child_query))
				    { 
					$child_list.="," . $child["id"];
					$thislist.="," . $child["id"];
				     //echo $rst["sbcat_id"];
				    }
	               $child_query=mysql_query("select * from sbreciprocal_cats where pid in (" . $thislist . ")" );
					}
					$ques_num=mysql_num_rows(mysql_query("select * from reciprocal_links where cid in ($child_list) and approved='yes'"));	
echo $ques_num;
					?>
		
		
        ) </font> </font></td>
      <?php if ($cnt%2==0) { ?>
    </tr>
    <?php } ?>
    <?php
						$cnt++;
					   }
					   ?>
  </table>
  </font> 
  <p><font face="Arial, Helvetica, sans-serif" size="2"> </font> <font size="2" face="Arial, Helvetica, sans-serif"><strong><a href="<?php echo $thispage ;?>?sbreciprocalfnx=addlink">ADD 
    YOUR LINK</a></strong></font><br>
  <p>&nbsp;
  <? echo "<P style=\"font-size:8px\"><b><a href=\"http://www.pdesigner.net\" title=\"Web Site Design Services\" >Web Script Development</a></b> by FWD</P>"; ?>
    <?
}
else
{
?>
  </p>
  <p><font size="2" face="Arial, Helvetica, sans-serif"><strong><a href="<?php echo $thispage ;?>?sbreciprocalfnx=addlink">ADD 
    YOUR LINK</a></strong></font> </p>
  <table width="600" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td><font size="2" face="Arial, Helvetica, sans-serif"><strong> Links </strong></font></td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
    </tr>
    <?
	$cnt=0;
  	$rs_query=mysql_query("Select * from reciprocal_links where approved='yes' and cid=" . $cid );
///////////////////////////////////PAGINATION /////////
$rs_query_t=mysql_query("Select * from reciprocal_config");
$row_t = mysql_fetch_array($rs_query_t);
$recperpage=$row_t["recperpage"]	;
	if(!isset($_REQUEST["pg"]))
	{
			$pg=1;
	}
	else 
	{
	$pg=$_REQUEST["pg"];
	}
$rcount=mysql_num_rows($rs_query);
if ($rcount==0 )
{ 
	$pages=0;
}	
else
{
	$pages=floor($rcount / $recperpage);
	if  (($rcount%$recperpage) > 0 )
	{
		$pages=$pages+1;
	}
}
$jmpcnt=0;
while ($jmpcnt<($pg-1)*$recperpage  && $row = mysql_fetch_array($rs_query) )
    {	
		$jmpcnt = $jmpcnt + 1;
	}

////////////////////////////////////////////////////////////////////////////////////
	
	
		$cnt=0;
		while (($rs=mysql_fetch_array($rs_query)) && $cnt<$recperpage )
				{
	$cnt++;
?>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td bgcolor="#f5f5f5"><strong><font color="#0066CC" size="2" face="Arial, Helvetica, sans-serif"><?php echo $cnt ;?>. 
        
		<a href="http://<?php echo $rs["link"] ;?>"><?php echo $rs["title"] ;?></a>
		
		</font></strong></td>
    </tr>
    <tr> 
      <td><font size="2" face="Arial, Helvetica, sans-serif"><?php echo $rs["description"] ;?></font></td>
    </tr>
   
    <?

		
		}
		$cnt=0;
?>
    <tr> 
      <td><TABLE cellSpacing=0 cellPadding=0 width=400 border=0>
          <TBODY>
            <TR> 
              <TD> <DIV align=center><br>
                  <br>
                <?
				if ($pages>1) {
				?>  
                  <TABLE width="225" border=0 cellPadding=0 cellSpacing=0>
                    <TBODY>
                      <TR> 
                        <TD> <font size="2" face="Arial, Helvetica, sans-serif"> 
                          <? if ($pg!=1){?>
                          </font><font face="Arial, Helvetica, sans-serif">
                          <div align="left"><font size="2" face="Arial, Helvetica, sans-serif"><a href="<?php echo $thispage ;?>?pg=<?php echo ($pg-1); ?><?php echo "$strpass"; ?>" > 
                            <? }?>
                            Prev 
                            <?	if ($pg!=1){?>
                            </a> 
                            <? } ?>
                            </font></div>
                          </font></TD>
                        <TD><font size="2" face="Arial, Helvetica, sans-serif">Page</font></TD>
                        <TD><font size="2" face="Arial, Helvetica, sans-serif"><IMG height=1 alt="" 
                                src="images/pix.gif" width=4 
                                border=0></font></TD>
                        <TD><B><FONT color=#191970 size="2" face="Arial, Helvetica, sans-serif"><?php echo $pg ;?> 
                          </FONT></B></TD>
                        <TD><font size="2" face="Arial, Helvetica, sans-serif"><IMG height=1 alt="" 
                                src="images/pix.gif" width=4 
                                border=0></font></TD>
                        <TD><font size="2" face="Arial, Helvetica, sans-serif">of</font></TD>
                        <TD><font size="2" face="Arial, Helvetica, sans-serif"><IMG height=1 alt="" 
                                src="images/pix.gif" width=4 
                                border=0></font></TD>
                        <TD><font size="2" face="Arial, Helvetica, sans-serif"><B><?php echo $pages; ?></B></font></TD>
                        <TD> <font size="2" face="Arial, Helvetica, sans-serif"> 
                          &nbsp; 
                          <? if ($pg!=$pages)



			{



			?>
                          <a href="<?php echo $thispage ;?>?pg=<?php echo ($pg+1); ?><?php echo "$strpass"; ?>" > 
                          <? }else{ }?>
                          Next 
                          <?
			if ($pg!=$pages){?>
                          </a> 
                          <? } ?>
                          </font></TD>
                      </TR>
                    </TBODY>
                  </TABLE>
                  <? } ?>
                </DIV></TD>
            </TR>
            <TR> 
              <TD><IMG height=3 alt="" 
                              src="images/pix.gif" width=1 
                            border=0></TD>
            </TR>
           <?
				if ($pages>1) {
				?>  <TR> 
              <TD> <DIV align=center><font size="2" face="Arial, Helvetica, sans-serif"> 
                  <?php



			  


if ($pg<=5)
{
	$jmpcnt=1;
}
else
{
	$jmpcnt=$pg-5;
}

$cnt=0;

	while (  $jmpcnt<=$pages   && $cnt<10 )



    {	

$cnt++;

           

		   if ($jmpcnt!=$pg)

		   {

		   ?>
                  <a href="<?php echo $thispage ;?>?pg=<?php echo "$jmpcnt$strpass"; ?>" > 
                  <?

			}

			else

			{

			echo "<b>";

			}

			echo $jmpcnt;

			if ($jmpcnt!=$pg)

		   {

		   ?>
                  </a> 
                  <?php

			}

          else

			{

			echo "</b>";

			}

			



if ($jmpcnt<$pages)



echo " | ";



?>
                  <?php



		$jmpcnt = $jmpcnt + 1;



	}



			



			?>
                  &nbsp;</font></DIV></TD>
            </TR><? } ?>
          </TBODY>
        </TABLE></td>
    </tr>
  </table>
  <p> 
    <?

}
?>
  </p>
</form>
<?php
}

///////////////////////////////////////////////////////////////////////////////
///      THE CODE OF THIS SCRIPT HAS BEEN DEVELOPED BY SOFTBIZ SOLUTIONS  /////
///      AND IS MEANT TO BE USED ON THIS SITE ONLY AND IS NOT FOR REUSE,  /////
///      RESALE OR REDISTRIBUTION.                                        ///// 
///      IF YOU NOTICE ANY VIOLATION OF ABOVE PLEASE REPORT AT:           /////
///       hide@address.com                                        /////
///      http://www.softbizscripts.com                                    /////
///      http://www.softbizsolutions.com                                  /////  
///////////////////////////////////////////////////////////////////////////////

?>
Return current item: PHP Reciprocial Links