i have maked just main card can u help me how to complete this script,,, n plz make next find page ....itz good feature for all lava site holders
///////////////////////////////////////////////////
else if($show=="main")
{
addonline(getuid_hits($hits),"FindAfriend","");
echo getheader($hits);
echo "<body>";
echo "<div class=\"box_cen\" align=\"center\">";
echo "<b>Find A Friend</b>";
echo "<div class=\"box_sub\" align=\"center\">";
echo "<form action=\"findafriend.php?show=find&hits=$hits\ " method=\"post\">";
echo "Name:<br/><input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"15\" maxlength=\"15\"/><br/>";
echo "Seeking:<br/><select name=\"sor\">";
echo "<option value=\"1\">Male</option>";
echo "<option value=\"2\">Female</option>";
echo "</select><br/>";
echo "Age:<br/><input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"2\" maxlength=\"2\"/> To <input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"2\" maxlength=\"2\"/><br/>";
echo "Relationship:<br/><select name=\"status\" value=\"Single\">";
echo "<option value=\"Single\">Single</option>";
echo "<option value=\"Engaged\">Engaged</option>";
echo "<option value=\"Married\">Married</option>";
echo "<option value=\"In Relationship\">In Relationship</option>";
echo "<option value=\"In Love\">In Love</option>";
echo "<option value=\"Its Complicated\">Its Complicated</option>";
echo "</select><br/>";
echo "Country:<br/><select name=\"state\" value=\"6\">";
echo "<option value=\"1\">India</option>";
echo "<option value=\"2\">Pakistan</option>";
echo "<option value=\"3\">South Africa</option>";
echo "<option value=\"4\">Sri Lanka</option>";
echo "<option value=\"5\">Bangla Desh</option>";
echo "<option value=\"6\">Pinoy</option>";
echo "<option value=\"14\">U.A.E</option>";
echo "<option value=\"7\">Q.S.A</option>";
echo "<option value=\"8\">ASIA</option>";
echo "<option value=\"9\">U.K</option>";
echo "<option value=\"10\">U.S.A</option>";
echo "<option value=\"11\">Australia</option>";
echo "<option value=\"12\">Urope</option>";
echo "<option value=\"13\">Malesia</option>";
echo "<option value=\"15\">Indonesia</option>";
echo "<option value=\"16\">Chaina</option>";
echo "<option value=\"17\">Other</option>";
echo "</select><br/>";
echo "City:<br/><input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"15\" maxlength=\"15\"/><br/>";
echo "<br/>";
echo "<input type=\"submit\" value=\"Find\"/></form><br/>";
echo "</div></div>";
include("wapv.php");
echo "</body>";
}
////////////////////////////////////////////
/////////////////////////////////////////////
else if($show=="find")
{
$stext = $_POST["stext"];
$sin = $_POST["sin"];
$sor = $_POST["sor"];
addonline(getuid_hits($hits),"FindAfriend","");
echo getheader($hits);
echo "<body>";
echo "<div class=\"box_cen\" align=\"center\">";
echo "<b>Find A Friend</b>";
echo "<div class=\"box_sub\" align=\"center\">";
if(trim($stext)=="")
{
echo "<br/>Failed to search for Members";
}else{
//begin search
$where_table = "mx_users";
$cond = "name";
$select_fields = "id, name";
if($sor=="1")
{
$ord_fields = "name";
}else if($sor=="2"){
$ord_fields = "lastact DESC";
}else if($sor=="3"){
$ord_fields = "regdate";
}
////////////
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ".$where_table." WHERE ".$cond." LIKE '%".$stext."%'"));
$num_items = $noi[0];
$items_per_page = 10;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
$sql = "SELECT ".$select_fields." FROM ".$where_table." WHERE ".$cond." LIKE '%".$stext."%' ORDER BY ".$ord_fields." LIMIT $limit_start, $items_per_page";
$items = mysql_query($sql);
while($item=mysql_fetch_array($items))
{
$tlink = "<a href=\"index.php?show=viewuser&hits=$hits& who=$item[0]\">".htmlspecialchars($item[1])."</a><br/>";
echo $tlink;
}
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
$rets = "<anchor>«PREV";
$rets .= "<go href=\"search.php?show=$show&hits=$hits&pa ge=$ppage\" method=\"post\">";
$rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
$rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
$rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
$rets .= "</go></anchor> ";
echo $rets;
}
if($page<$num_pages)
{
$npage = $page+1;
$rets = "<anchor>Next»";
$rets .= "<go href=\"search.php?show=$show&hits=$hits&pa ge=$npage\" method=\"post\">";
$rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
$rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
$rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
$rets .= "</go></anchor> ";
echo $rets;
}
echo "<br/>$page/$num_pages<br/>";
if($num_pages>2)
{
$rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
$rets .= "<anchor>[GO]";
$rets .= "<go href=\"search.php?show=$show&hits=$hits&pa ge=$(pg)\" method=\"post\">";
$rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
$rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
$rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
$rets .= "</go></anchor>";
echo $rets;
}
echo "</p>";
}
echo "</div></div>";
include("wapv.php");
echo "</body>";
}
///////////////////////////////////////////////////
else if($show=="main")
{
addonline(getuid_hits($hits),"FindAfriend","");
echo getheader($hits);
echo "<body>";
echo "<div class=\"box_cen\" align=\"center\">";
echo "<b>Find A Friend</b>";
echo "<div class=\"box_sub\" align=\"center\">";
echo "<form action=\"findafriend.php?show=find&hits=$hits\ " method=\"post\">";
echo "Name:<br/><input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"15\" maxlength=\"15\"/><br/>";
echo "Seeking:<br/><select name=\"sor\">";
echo "<option value=\"1\">Male</option>";
echo "<option value=\"2\">Female</option>";
echo "</select><br/>";
echo "Age:<br/><input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"2\" maxlength=\"2\"/> To <input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"2\" maxlength=\"2\"/><br/>";
echo "Relationship:<br/><select name=\"status\" value=\"Single\">";
echo "<option value=\"Single\">Single</option>";
echo "<option value=\"Engaged\">Engaged</option>";
echo "<option value=\"Married\">Married</option>";
echo "<option value=\"In Relationship\">In Relationship</option>";
echo "<option value=\"In Love\">In Love</option>";
echo "<option value=\"Its Complicated\">Its Complicated</option>";
echo "</select><br/>";
echo "Country:<br/><select name=\"state\" value=\"6\">";
echo "<option value=\"1\">India</option>";
echo "<option value=\"2\">Pakistan</option>";
echo "<option value=\"3\">South Africa</option>";
echo "<option value=\"4\">Sri Lanka</option>";
echo "<option value=\"5\">Bangla Desh</option>";
echo "<option value=\"6\">Pinoy</option>";
echo "<option value=\"14\">U.A.E</option>";
echo "<option value=\"7\">Q.S.A</option>";
echo "<option value=\"8\">ASIA</option>";
echo "<option value=\"9\">U.K</option>";
echo "<option value=\"10\">U.S.A</option>";
echo "<option value=\"11\">Australia</option>";
echo "<option value=\"12\">Urope</option>";
echo "<option value=\"13\">Malesia</option>";
echo "<option value=\"15\">Indonesia</option>";
echo "<option value=\"16\">Chaina</option>";
echo "<option value=\"17\">Other</option>";
echo "</select><br/>";
echo "City:<br/><input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"15\" maxlength=\"15\"/><br/>";
echo "<br/>";
echo "<input type=\"submit\" value=\"Find\"/></form><br/>";
echo "</div></div>";
include("wapv.php");
echo "</body>";
}
////////////////////////////////////////////
/////////////////////////////////////////////
else if($show=="find")
{
$stext = $_POST["stext"];
$sin = $_POST["sin"];
$sor = $_POST["sor"];
addonline(getuid_hits($hits),"FindAfriend","");
echo getheader($hits);
echo "<body>";
echo "<div class=\"box_cen\" align=\"center\">";
echo "<b>Find A Friend</b>";
echo "<div class=\"box_sub\" align=\"center\">";
if(trim($stext)=="")
{
echo "<br/>Failed to search for Members";
}else{
//begin search
$where_table = "mx_users";
$cond = "name";
$select_fields = "id, name";
if($sor=="1")
{
$ord_fields = "name";
}else if($sor=="2"){
$ord_fields = "lastact DESC";
}else if($sor=="3"){
$ord_fields = "regdate";
}
////////////
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ".$where_table." WHERE ".$cond." LIKE '%".$stext."%'"));
$num_items = $noi[0];
$items_per_page = 10;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
$sql = "SELECT ".$select_fields." FROM ".$where_table." WHERE ".$cond." LIKE '%".$stext."%' ORDER BY ".$ord_fields." LIMIT $limit_start, $items_per_page";
$items = mysql_query($sql);
while($item=mysql_fetch_array($items))
{
$tlink = "<a href=\"index.php?show=viewuser&hits=$hits& who=$item[0]\">".htmlspecialchars($item[1])."</a><br/>";
echo $tlink;
}
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
$rets = "<anchor>«PREV";
$rets .= "<go href=\"search.php?show=$show&hits=$hits&pa ge=$ppage\" method=\"post\">";
$rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
$rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
$rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
$rets .= "</go></anchor> ";
echo $rets;
}
if($page<$num_pages)
{
$npage = $page+1;
$rets = "<anchor>Next»";
$rets .= "<go href=\"search.php?show=$show&hits=$hits&pa ge=$npage\" method=\"post\">";
$rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
$rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
$rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
$rets .= "</go></anchor> ";
echo $rets;
}
echo "<br/>$page/$num_pages<br/>";
if($num_pages>2)
{
$rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
$rets .= "<anchor>[GO]";
$rets .= "<go href=\"search.php?show=$show&hits=$hits&pa ge=$(pg)\" method=\"post\">";
$rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
$rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
$rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
$rets .= "</go></anchor>";
echo $rets;
}
echo "</p>";
}
echo "</div></div>";
include("wapv.php");
echo "</body>";
}
Comment