FIND A FriEnd SCRIPT (forLAVA ) Help To all Coding-talk programmer

Started on the old forum in February 2011 · view the original in the archive · old links redirect here

8 replies · 907 views · started 15 years ago · 2 min read

4 participants
wapcult Developer · 53 posts #1

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 ""; echo "Find A Friend"; echo ""; echo "<form action="findafriend.php?show=find&hits=$hits" method="post">"; echo "Name: <input name="refer" style="-wap-input-format: '*N'" size="15" maxlength="15"/> "; echo "Seeking: <select name="sor">"; echo "<option value="1">Male</option>"; echo "<option value="2">Female</option>"; echo "</select> "; echo "Age: <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"/> "; echo "Relationship: <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> "; echo "Country: <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>

"; echo "City: <input name="refer" style="-wap-input-format: '*N'" size="15" maxlength="15"/> "; echo " "; echo "<input type="submit" value="Find"/></form> ";

echo ""; 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 ""; echo "Find A Friend"; echo "";

    if(trim($stext)=="")
    {
        echo "

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&amp;hits=$hits&amp;who=$item[0]\">".htmlspecialchars($item[1])."</a>

";

            echo  $tlink;

      }
      echo "

"; if($page>1) { $ppage = $page-1; $rets = "<anchor>«PREV"; $rets .= "<go href="search.php?show=$show&hits=$hits&page=$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&amp;hits=$hits&amp;page=$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 "

$page/$num_pages "; 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&page=$(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 "

"; }

echo ""; include("wapv.php"); echo "</body>"; }

VISIT US FOR FREE EARN

http://POCK.IN

MOBILE ADVERTISEMENT & EARN MONEY

wapcult Developer · 53 posts #2

no 1 programmer here? itz a looser programmer site most helped post is empty here

itz true no 1 make own programming only theping script n just modifyed only

VISIT US FOR FREE EARN

http://POCK.IN

MOBILE ADVERTISEMENT & EARN MONEY

ewanz Developer · 187 posts #3

what do you want mate?

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
wapcult Developer · 53 posts #4

i wont help to makin a member search script bt no1 here intrested ....i will make a findafriend script with latest search option example searh tag name sex age location etc

VISIT US FOR FREE EARN

http://POCK.IN

MOBILE ADVERTISEMENT & EARN MONEY

tkreturns Developer · 98 posts #5

its already available on the net lol

ASK FOR HELP

wapcult Developer · 53 posts #6

i knw bt not workin in lava wait 1 day i will complete dat script

VISIT US FOR FREE EARN

http://POCK.IN

MOBILE ADVERTISEMENT & EARN MONEY

tkreturns Developer · 98 posts #7

tats the spirit lol

ASK FOR HELP

ksg91 Developer · 162 posts #8

wapcult wrote: itz true no 1 make own programming only theping script n just modifyed only

No one? dude, here , we have many great programmers. One thing that suck is lava because to add something we have to read whole code and lava is not nicely coded to integrate something easily.

Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

wapcult Developer · 53 posts #9

completed

i complete 99% only one error confiused me can u tell me where i m wrong

this error was showin/// Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/wapcult/public_html/wap/findafriend.php on line 194 /////////////// i have checked my sql itz right bt why dat show wrong

/////////////////////////////////////////////////// if($show=="main") { addonline(getuid_hits($hits),"FindAfriend",""); echo getheader($hits); echo "<body>"; echo ""; echo "Find A Friend"; echo ""; echo "

<form action=\"findafriend.php?show=find&amp;hits=$hits\" method=\"post\"> Username:

<input name="name" maxlength="12"/>

Age:

<select name="age">

<option value=\"1\">All</option> <option value=\"2\">14-18</option> <option value=\"3\">19-25</option> <option value=\"4\">26-34</option> <option value=\"5\">35-49</option> <option value=\"6\">50+</option> </select>

Sex:

<select name="sex">

<option value=\"B\">Both</option> <option value=\"M\">Male</option> <option value=\"F\">Female</option> </select>

Country: <select name="state" value="1">

<option value=\"1\">India</option>
<option value=\"2\">Pakistan</option>

<option value=\"3\">South Africa</option>

<option value=\"4\">Sri Lanka</option>

<option value=\"5\">Bangla Desh</option>

<option value=\"6\">Pinoy</option>

<option value=\"14\">U.A.E</option>
<option value=\"7\">Q.S.A</option> <option value=\"8\">ASIA</option> <option value=\"9\">U.K</option>
<option value=\"10\">U.S.A</option>

<option value=\"11\">Australia</option>
<option value=\"12\">Urope</option> <option value=\"13\">Malesia</option>
<option value=\"15\">Indonesia</option>
<option value=\"16\">Chaina</option>
<option value=\"17\">Other</option>
</select>

<input type="submit" value="Find"/>

</form>";

echo ""; 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 ""; echo "Find A Friend"; echo "";

if($name!=""){$part1="name LIKE '%".$name."%'";$and="AND"; } if($sex!="B"){$part2="$and sex = '".$sex."'";$and="AND"; } else if($sex=="B"){$part2="$and sex != ''";$and="AND"; } if($contry!=""){$part3="$and location LIKE '%".$location."%'";$and="AND"; } if($age!=1){ if($age==2){ $min=date('Y-m-d',strtotime('-14 years')); $max=date('Y-m-d',strtotime('-19 years')); } else if($age==3){ $min=date('Y-m-d',strtotime('-19 years')); $max=date('Y-m-d',strtotime('-26 years')); } else if($age==4){ $min=date('Y-m-d',strtotime('-26 years')); $max=date('Y-m-d',strtotime('-35 years')); } else if($age==5){ $min=date('Y-m-d',strtotime('-35 years')); $max=date('Y-m-d',strtotime('-50 years')); } else if($age==6){ $min=date('Y-m-d',strtotime('-50 years')); $max=date('Y-m-d',strtotime('-101 years')); } $part4="$and birthday<'".$min."' AND birthday>'".$max."'"; } //////////// $noi = mysql_fetch_array(mysql_query("SELECT COUNT() FROM mx_users WHERE $part1 $part2 $part3 $part4")); $num_items = $noi[0]; $items_per_page = 8; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)$items_per_page;

////////id, name, sex, birthday, location///////////////////////

$sql = "SELECT id, name, sex, birthday, location FROM mx_users WHERE $part1 $part2 $part3 $part4 ORDER BY name LIMIT $limit_start, $items_per_page";

      $items = mysql_query($sql);
   
      while($item=mysql_fetch_array($items))
      {

$foto = idle($item[0], 45, 45); $link = "<a href="index.php?show=viewuser&hits=$hits&who=$item[0]">".htmlspecialchars($item[1])."</a>";

            echo "<left>$foto</left> <right>$link</right><hr>";

echo ""; } echo ""; if($page>1) { $ppage = $page-1; $rets = "<anchor>«PREV"; $rets .= "<go href="search.php?show=$show&hits=$hits&page=$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&amp;hits=$hits&amp;page=$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 "

$page/$num_pages "; 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&page=$(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 "";

echo "<a href="findafriend.php?show=main&hits=$hits"><img src="images/search.gif" alt="*"/>"; echo "FindAfriend</a> "; echo ""; include("wapv.php"); echo "</body>"; }

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

i complete 99% only one error confiused me can u tell me where i m wrong

this error was showin/// Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/wapcult/public_html/wap/findafriend.php on line 194 /////////////// i have checked my sql itz right bt why dat show wrong

/////////////////////////////////////////////////// if($show=="main") { addonline(getuid_hits($hits),"FindAfriend",""); echo getheader($hits); echo "<body>"; echo ""; echo "Find A Friend"; echo ""; echo "

<form action=\"findafriend.php?show=find&amp;hits=$hits\" method=\"post\"> Username:

<input name="name" maxlength="12"/>

Age:

<select name="age">

<option value=\"1\">All</option> <option value=\"2\">14-18</option> <option value=\"3\">19-25</option> <option value=\"4\">26-34</option> <option value=\"5\">35-49</option> <option value=\"6\">50+</option> </select>

Sex:

<select name="sex">

<option value=\"B\">Both</option> <option value=\"M\">Male</option> <option value=\"F\">Female</option> </select>

Country: <select name="state" value="1">

<option value=\"1\">India</option>
<option value=\"2\">Pakistan</option>

<option value=\"3\">South Africa</option>

<option value=\"4\">Sri Lanka</option>

<option value=\"5\">Bangla Desh</option>

<option value=\"6\">Pinoy</option>

<option value=\"14\">U.A.E</option>
<option value=\"7\">Q.S.A</option> <option value=\"8\">ASIA</option> <option value=\"9\">U.K</option>
<option value=\"10\">U.S.A</option>

<option value=\"11\">Australia</option>
<option value=\"12\">Urope</option> <option value=\"13\">Malesia</option>
<option value=\"15\">Indonesia</option>
<option value=\"16\">Chaina</option>
<option value=\"17\">Other</option>
</select>

<input type="submit" value="Find"/>

</form>";

echo ""; 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 ""; echo "Find A Friend"; echo "";

if($name!=""){$part1="name LIKE '%".$name."%'";$and="AND"; } if($sex!="B"){$part2="$and sex = '".$sex."'";$and="AND"; } else if($sex=="B"){$part2="$and sex != ''";$and="AND"; } if($contry!=""){$part3="$and location LIKE '%".$location."%'";$and="AND"; } if($age!=1){ if($age==2){ $min=date('Y-m-d',strtotime('-14 years')); $max=date('Y-m-d',strtotime('-19 years')); } else if($age==3){ $min=date('Y-m-d',strtotime('-19 years')); $max=date('Y-m-d',strtotime('-26 years')); } else if($age==4){ $min=date('Y-m-d',strtotime('-26 years')); $max=date('Y-m-d',strtotime('-35 years')); } else if($age==5){ $min=date('Y-m-d',strtotime('-35 years')); $max=date('Y-m-d',strtotime('-50 years')); } else if($age==6){ $min=date('Y-m-d',strtotime('-50 years')); $max=date('Y-m-d',strtotime('-101 years')); } $part4="$and birthday<'".$min."' AND birthday>'".$max."'"; } //////////// $noi = mysql_fetch_array(mysql_query("SELECT COUNT() FROM mx_users WHERE $part1 $part2 $part3 $part4")); $num_items = $noi[0]; $items_per_page = 8; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)$items_per_page;

////////id, name, sex, birthday, location///////////////////////

$sql = "SELECT id, name, sex, birthday, location FROM mx_users WHERE $part1 $part2 $part3 $part4 ORDER BY name LIMIT $limit_start, $items_per_page";

      $items = mysql_query($sql);
   
      while($item=mysql_fetch_array($items))
      {

$foto = idle($item[0], 45, 45); $link = "<a href="index.php?show=viewuser&hits=$hits&who=$item[0]">".htmlspecialchars($item[1])."</a>";

            echo "<left>$foto</left> <right>$link</right><hr>";

echo ""; } echo ""; if($page>1) { $ppage = $page-1; $rets = "<anchor>«PREV"; $rets .= "<go href="search.php?show=$show&hits=$hits&page=$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&amp;hits=$hits&amp;page=$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 "

$page/$num_pages "; 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&page=$(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 "";

echo "<a href="findafriend.php?show=main&hits=$hits"><img src="images/search.gif" alt="*"/>"; echo "FindAfriend</a> "; echo ""; include("wapv.php"); echo "</body>"; }

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

VISIT US FOR FREE EARN

http://POCK.IN

MOBILE ADVERTISEMENT & EARN MONEY

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close