//Number of records to show per page
$limit = $nolinks;
//Set the default offset = 0
$offset = ($offset) ? $offset : 0;
//Encoded query string that needs to be passed to each page
if ($cat) {$query = "&cat=".urlencode($cat);}
if ($category) { $query= "&category=".urlencode($category);}
if ($category) {
// Fetch the cat_id from database using lcat_name
$mysql_mylink = mysql_connect($mysql_host, $mysql_user, $mysql_pass)
or die ("Cannot make the connection");
mysql_select_db($mysql_db, $mysql_mylink)
or die ("Cannot connect to the database");
$rime1= mysql_query("SELECT * FROM category WHERE lcat_name LIKE '$category'");
while($row = mysql_fetch_array($rime1)) {
extract($row);
$cat = $row["lcat_id"];
$namea = $row["lcat_name"];}
}
$mysql_mylink = mysql_connect($mysql_host, $mysql_user, $mysql_pass)
or die ("Cannot make the connection");
mysql_select_db($mysql_db, $mysql_mylink)
or die ("Cannot connect to the database");
//echo "
$lcat_name Category
";
$rime1 = mysql_query("SELECT COUNT(*) from links WHERE link_val LIKE 'yes' AND cat_id LIKE '$cat'") or die(mysql_error());
$totalnum = mysql_result($rime1, 0, 0);
$rime2 = mysql_query("SELECT * from category WHERE lcat_id='$cat'")
or die(mysql_error());
while($row = mysql_fetch_array($rime2)) {
extract($row);
$id = $row["lcat_id"];
$name = $row["lcat_name"];
$sub_cat = $row["sub_cat"];
$navigator = $name . "" ;
$rime5= mysql_query("SELECT * FROM category WHERE lcat_id='$sub_cat'");
$lista = mysql_num_rows($rime5);
$rowa = mysql_fetch_array($rime5);
$ida = $rowa["lcat_id"];
$namea = $rowa["lcat_name"];
$sub_cat = $rowa["sub_cat"];
$linnk1 = "$namea >";
$navigator = $linnk1 . " " .$navigator;
while ($sub_cat > 0) {
$rime3= mysql_query("SELECT * FROM category WHERE lcat_id='$sub_cat'");
$lista = mysql_num_rows($rime3);
$rowa = mysql_fetch_array($rime3);
$ida = $rowa["lcat_id"];
$namea = $rowa["lcat_name"];
$sub_cat = $rowa["sub_cat"];
$linnk = "$namea >";
}
$navigator = $linnk . " " . $navigator;
?>
";
}
//articles
if($a=='ca')
{
# display the corresponding category
$file = array(
"1"=>'beauty.htm',
"2"=>'health.htm',
"3"=>'parenting.htm',
"4"=>'shopping.htm',
"5"=>'recreation.htm',
"6"=>'money.htm',
"7"=>'home-garden.htm',
"8"=>'food.htm',
"9"=>'diet.htm',
"10"=>'work.htm'
);
if(isset($file["$cat"]) and is_file($file["$cat"])){
include($file["$cat"]);
}
}
}
$rime = mysql_query("SELECT * from links WHERE link_val like 'yes' AND cat_id LIKE '$cat' ORDER BY rate DESC, link_pop DESC, hits DESC LIMIT $offset, $limit") or die(mysql_error());
while($row = mysql_fetch_array($rime)) {
extract($row);
if ($rate > 0)
{
$arate = sprintf ("%.2f", ($rating / $rate));
}
else
{
$arate = '0';
}
//new changes
if($a != 'ca'){
$linko=str_replace("http://","",$link_url);
// Redirection 28/8/13
$link_url='https://www.targetwoman.com/cgi-bin/find.pl?' . $link_url;
echo " $link_name ";
echo " $link_desc ";
echo " $linko ";
echo " More Details on $link_name
";
}
}
freddyShowNav($totalnum, $query, $offset, $limit,$a);
function freddyShowNav($totalnum, $query, $offset, $limit,$a) {
global $PHP_SELF;
$query=explode("=",$query);
$query=$query[1];
if ($totalnum > $limit) {
// calculate number of pages needing links
$pages = intval($totalnum/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
if ($totalnum%$limit) $pages++;
if (($offset + $limit) > $totalnum) {
$lastnum = $totalnum;
}
else {
$lastnum = ($offset + $limit);
}
?>
Page
for ($i=1; $i <= $pages; $i++) { // loop thru
$newoffset=$limit*($i-1);
if ($newoffset != $offset) {
?>
}
else {
if($a == 'ca'){
?>
} else{
?>
}
}
}
?>
//echo "
";
}
return;
}
echo ""
?>
{
function ShowNav($totalnum, $query, $offset, $limit, $query1) {
global $PHP_SELF;
if ($totalnum > $limit) {
// calculate number of pages needing links
$pages = intval($totalnum/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
if ($totalnum%$limit) $pages++;
if (($offset + $limit) > $totalnum) {
$lastnum = $totalnum;
}
else {
$lastnum = ($offset + $limit);
}
?>
Page
for ($i=1; $i <= $pages; $i++) { // loop thru
$newoffset=$limit*($i-1);
if ($newoffset != $offset) {
?>
include "footer.inc.php"; ?>
exit;
}
if ($action=="rated")
{
$sitenames = "$sitename Rate It";
?>
$mysql_mylink = mysql_connect($mysql_host, $mysql_user, $mysql_pass)
or die ("Cannot make the connection");
mysql_select_db($mysql_db, $mysql_mylink)
or die ("Cannot connect to the database");
$result= mysql_query("SELECT link_keyword,link_desc,link_name,link_id, hits, link_url FROM links WHERE link_id = '$link_id'")
or die(mysql_error());
if (!ereg("^[0-9]+$", $link_id))
{
include("index.php");
exit;
}
while ($row = mysql_fetch_array($result))
{
$link_keyword = $row["link_keyword"];
$link_desc = $row["link_desc"];
$link_name = $row["link_name"];
$hits = $row["hits"];
$link_id = $row["link_id"];
$link_url = $row["link_url"];
}
$hits++;
$result2 = @mysql_query("UPDATE links SET hits = '$hits' WHERE link_id = '$link_id'");
// old redirection method
// if (!headers_sent()) {
// header ('Location: $link_url');
// exit;
//}
// Display the details here
$linko="https://www.targetwoman.com/cgi-bin/find.pl?$link_url";
if (ereg("None Available", $link_keyword))
{ $link_keyword ="targetwoman,women directory,women portal";
}
/*if (!ereg("http://", $link_url))
{ $link_keyword="targetwoman,women directory,women portal";
$link_desc="This link has been removed from the Targetwoman Directory. The editors of Targetwoman directory prune the listings regularly in consonance with our policy of retaining only valid useful listings.";
$link_name="Targetwoman Women Directory";
$do=1;
}*/
?>
echo "$link_name"?>
echo ""?>
echo ""?>
Targetwoman - Portal Directory for Women
Targetwoman Women Directory lists thousands of high quality websites - carefully chosen by human editors exclusively for women. Combined with the painstakingly written articles from the Women Portal section, we strive hard to offer one of the most rewarding experiences on the Net.
include('top-ad.php'); ?>
We aim to include only a handful of sites under each category.
We prefer quality to quantity.
Even if your site is small or just launched, we are ready to offer prime exposure subject to the condition that your site offers something of unique value to our visitors.
include "footer.inc.php";
exit;
?>
}
if ($search)
{
$sitenames = "$sitename - Search Result for $search";
include('header.inc.php');
?>
$mysql_mylink = mysql_connect($mysql_host, $mysql_user, $mysql_pass)
or die ("Cannot make the connection");
mysql_select_db($mysql_db, $mysql_mylink)
or die ("Cannot connect to the database");
$limit = $nolinkssearch;
$offset = ($offset) ? $offset : 0;
$searchwords = split ( "[ ,]", $search );
$search = strtoupper($search);
echo "$sitename : Search Results";
$first = true;
foreach ( $searchwords as $word )
{
if ( $first )
{
$first = false;
$like .= " WHERE ";
}
elseif ( $andor == "or" )
$like .= " OR ";
else
$like .= " AND ";
$word = chop ( $word );
$like .= "link_val = 'yes' AND (link_id LIKE '%$word%' OR link_name LIKE '%$word%' OR link_desc LIKE '%$word%' OR link_keyword LIKE '%$word%' OR link_url LIKE '%$word%' OR link_pop LIKE '%$word%')";
}
$words =$word;
if (strlen($words) < 3)
{
echo "
TargetWoman Directory search for $search resulted in the following matches : $totalnum pages