Spiderwap Script Help!

Started on the old forum in April 2008 · view the original in the archive · old links redirect here

5 replies · 567 views · started 18 years ago · 1 min read

2 participants
HUMAYUN Newbie · 7 posts #1

hi Need help to add search engine in my site http://wap.mobifrendz.net/.. thanks in advance.

<?php

?>
<?php
echo("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
  <meta http-equiv="Cache-Control" content="no-cache"/>
  <meta http-equiv="Cache-Control" content="must-revalidate"/>
<title>Free mobile downloads</title>
   <link rev="made" href="" />      
<link rev="start" href="../../My Documents/mobifrendz/public_html/wap/." title="Home Page" />   
<link rel="shortcut icon" type="image/x-icon" href="../../My Documents/mobifrendz/public_html/wap/img/ico.gif" />   
<meta http-equiv="Cache-Control" content="must-revalidate" />   
<meta http-equiv="Cache-Control" content="no-cache" />   
<meta name="description" content="description" />   
<meta name="keywords" content="adult mp3 movies 3gp tones videos walpapers & forums toplist services wapmasters" />

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
<body>
<div class="top">
[img]img/logo.gif[/img]
<div>
[b][size="1"]<? $site_name ?>Mobi Downloads[/size][/b]</div>
</div>

[size="1"]The ultimate mobile entertainment portal [/size]!!

[b][size="1"]
  <?php

echo "<img src=\"../img/a.gif\" alt=\"*\"/> <a href=\"movies/index.php\">*Movies*</a>
";
echo "<img src=\"../img/a.gif\" alt=\"*\"/> <a href=\"videos/index.php\">*Videos*</a>
";
echo "<img src=\"../img/a.gif\" alt=\"*\"/> <a href=\"mp3/index.php\">*mp3's*</a>
";
echo "<img src=\"../img/a.gif\" alt=\"*\"/> <a href=\"softwares/index.php\">*software's*</a>
";
echo "<img src=\"../img/a.gif\" alt=\"*\"/> <a href=\"tones/index.php\">*Tones*</a>
";
echo "<img src=\"../img/a.gif\" alt=\"*\"/> <a href=\"wallpapers/index.php\">*Wallpapers*</a>
";

?>
<form action="/cgi-sys/entropysearch.cgi" target=searchwindow>
Search Query <input type="text" name="query" value="">
<input type="hidden" name="user" value="huma">
<input type="hidden" name="basehref" value="http://mobifrendz.net">
<input type="hidden" name="template" value="default">
<input type="submit" value="Search">
</form>
  [/size][/b]</p>
<div class="foot">
[url="www.mobifrendz.org"]Vist our Forum[/url]

<div>
© <? $site_name ?>2008-Mobifrendz Community</div>  
</div>
</body>
</html>

<?php
HUMAYUN Newbie · 7 posts #3

pls vist my site,,i want search engine in each n every page. thx@rukia

HUMAYUN Newbie · 7 posts #5

i want to add file search in every section . this is section index code on my site

<?
include("../wap_settings.php");
if (!isset($page)) {$page = 0;}
$total = 0;

if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array(); 
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php" and $file != "search.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];

while (list($fileIndexValue, $file_name) = each ($file_array))
{

if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{

echo "<a href=\"$file_name\">$file_name</a> (". round(filesize($file_name)/1024,1) . "kb)<div></div>";
$total = $total + filesize($file_name);
}
}

if (($file_count > 0) AND ($page != 0))
                {
                // previous button
                $prev_page = $page -1;
                echo "
<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Prev</a>
";
                }
            
            
            if (($file_count > 0) AND ($last_record < $file_count))
                {
                $next_page = $page + 1;
                
                echo "
<a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Next</a>
";
                }
            echo "
Directory:
$file_count ";
            if ($file_count == 1)
                {echo "file";}
            else
                {echo "files";}
                
            echo " (" . round($total/1024,1) . "kb)";
            echo "
<a href=http://wap.mobifrendz.net/>Home</a>";
            echo "
<a href=\"../index.php\">Back</a>";
            }
        closedir($dp);
        ?>

<div class="foot">
</small>[/b]

<div>
© <? $site_name ?>2008-Mobifrendz Community</div>  
</div>
</body>
</html>
<?

need file search option..pls help

rukiya Lead · 569 posts #6

here is a code that will search file in a directory. modify it for you script

<?php
$ac = $_GET["ac"];
if($ac=="a")
{
$directory = '/var/www/'; //Mention the correct pathway of the diretory
$filename = $_POST["filename"]; //what to look for
$flag = false;
$ext = array( '.jpg' , '.gif' , '.png' , '.mp3' , '.wav' ,'.mid' ,'.3gp' ,'.mpg' ,'.sis' ,'.jar' ,'.jad' ,'.mmf' ,'.nth' ,'.avi','.wmv');
for( $i = 0; count( $ext ) > $i; $i++ )
{
     if( file_exists( $directory . $filename . $ext[$i] ) )
     {
          $flag = true;
          $name = $filename . $ext[$i];
     }
}

if( $flag == true )
{
     echo 'found file!';
     echo $name;
}
else 
{ 
     echo 'cannot found $name';
}
}
?>
<?php
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
  echo "<card id=\"main\" title=\"Search\">";
  echo "<p align=\"center\">";
  echo "<input name=\"filename\" maxlength=\"30\"/>
";
  echo "<anchor>Search<go href=\"search.php?ac=a\" method=\"post\">";
  echo "<postfield name=\"filename\" value=\"$(filename)\"/>";
  echo "</go></anchor>
";
echo "</p></card>";
?>
</wml>

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