help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    help

    here i attch auto index script,i got only index.php,and confiq.php files,its working fine in Category wise,but main folder showen No files in the directory,
    pls help me code main index...

    demo http://wapindia.mobi/ANI/

    working Category url http://wapindia.mobi/ANI/240x320
    Attached Files
    Last edited by mrwhite; 06.09.09, 07:24.

    #2
    cant open it... isit in zend?
    Free WebHosting :D

    8):closedeyes:^_^

    Comment


      #3
      index.php

      Code:
      <?php header("Content-type:text/vnd.wap.wml");?>
      <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd" >
      <wml>
      <?php
      $site = $_REQUEST['site'];
      $url = $_REQUEST['url'];
      echo "<card id=\"wapbd\" title=\"Wapindia.mobi ™\">";
      ?>
      <p align="left">
      
       <?php
      // AdMob Publisher Code
      // Language: PHP
      // Version: 20080401
      // Copyright AdMob, Inc., All rights reserved
      
      // change to "live" when ready to deploy
      define("ADMOB_MODE", "live");
      
      function admob_append_params(&$params, $key, $val) {
        if(!empty($val)) $params .= ("&" . urlencode($key) . "=" . urlencode($val));
      }
      function admob_append_headers(&$params) {
        $admob_ignore = array("HTTP_PRAGMA","HTTP_CACHE_CONTROL","HTTP_CONNECTION","HTTP_USER_AGENT","HTTP_COOKIE");
        foreach ( array_keys( $_SERVER ) as $var ) {
          if ( substr( $var, 0, 4 ) == "HTTP" && !in_array( $var, $admob_ignore ) ) {
            $params .= "&" . urlencode("h[" . $var . "]" ) . "=" . urlencode( $_SERVER[$var] );
          }
        }
      }
      function admob_ad($admob_params=array()) {
        // build url
        $admob_page_url  = sprintf("http%s://%s%s",
        (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == TRUE ? "s": ""),
        $_SERVER["HTTP_HOST"],
        $_SERVER["REQUEST_URI"]
        );
        $md5_sid = session_id();
        if(!empty($md5_sid)) $md5_sid = md5($md5_sid);
        $admob_post = "s=" . $admob_params[ADMOB_SITE_ID];
        admob_append_params($admob_post, "u", $_SERVER["HTTP_USER_AGENT"]);
        admob_append_params($admob_post, "i", $_SERVER["REMOTE_ADDR"]);
        admob_append_params($admob_post, "p", $admob_page_url);
        admob_append_params($admob_post, "t", $md5_sid);
        admob_append_params($admob_post, "e", "UTF-8"); 
        admob_append_params($admob_post, "ma", $admob_params[ADMOB_MARKUP]);
        admob_append_params($admob_post, "v", ADMOB_VERSION);
        admob_append_params($admob_post, "d[pc]", $admob_params[ADMOB_POSTAL_CODE]);
        admob_append_params($admob_post, "d[ac]", $admob_params[ADMOB_AREA_CODE]);
        admob_append_params($admob_post, "d[coord]", $admob_params[ADMOB_COORDINATES]);
        admob_append_params($admob_post, "d[dob]", $admob_params[ADMOB_DOB]);
        admob_append_params($admob_post, "d[gender]", $admob_params[ADMOB_GENDER]);
        admob_append_params($admob_post, "k", $admob_params[ADMOB_KEYWORDS]);
        admob_append_params($admob_post, "search", $admob_params[ADMOB_SEARCH]);
        admob_append_headers($admob_post);
        if(ADMOB_MODE == "test") $admob_post .= "&m=test";
      
        // request ad
        $admob_request = @fsockopen(ADMOB_HOST, 80);
        if ($admob_request) {
          stream_set_timeout($admob_request, ADMOB_TIMEOUT);
          fwrite($admob_request, "POST " . ADMOB_ENDPOINT ." HTTP/1.0\r\n");
          fwrite($admob_request, "Host: " . ADMOB_HOST . "\r\n");
          fwrite($admob_request, "Content-Type: application/x-www-form-urlencoded\r\n");
          fwrite($admob_request, "Content-Length: " . strlen($admob_post). "\r\n\r\n");
          fwrite($admob_request, $admob_post);
          $admob_info = stream_get_meta_data($admob_request);
          $admob_timeout = $admob_info['timed_out'];
          $admob_contents = "";
          $admob_body = false;
          while (!feof($admob_request) && !$admob_timeout) {
            $admob_line = fgets($admob_request);
            if(!$admob_body && $admob_line == "\r\n") $admob_body = true;
            if($admob_body && !empty($admob_line)) $admob_contents .= $admob_line;
            $admob_info = stream_get_meta_data($admob_request);
            $admob_timeout = $admob_info['timed_out'];
          }
          fclose($admob_request);
          if($admob_timeout) {
            return "<img src=\"http://t.admob.com/li.php/c.gif/u/" . $admob_params[ADMOB_SITE_ID] . "/1/" . ADMOB_TIMEOUT . "/" . md5($admob_page_url) . "\" alt=\"\" width=\"1\" height=\"1\" />";
          } else {
            return $admob_contents;
          }
        }
      }
      define("ADMOB_SITE_ID", "ADMOB_SITE_ID");
      define("ADMOB_HOST", "r.admob.com");
      define("ADMOB_ENDPOINT", "/ad_source.php");
      define("ADMOB_VERSION", "20080401-PHPF-a447a68fbd5a488a");
      define("ADMOB_TIMEOUT", 1);
      define("ADMOB_MARKUP", "ADMOB_MARKUP");
      define("ADMOB_AREA_CODE", "ADMOB_AREA_CODE");
      define("ADMOB_COORDINATES", "ADMOB_COORDINATES");
      define("ADMOB_POSTAL_CODE", "ADMOB_POSTAL_CODE");
      define("ADMOB_DOB", "ADMOB_DOB");
      define("ADMOB_GENDER", "ADMOB_GENDER");
      define("ADMOB_KEYWORDS", "ADMOB_KEYWORDS");
      define("ADMOB_SEARCH", "ADMOB_SEARCH");
      ?>
      
      <?php
      $admob_params = array(
          ADMOB_SITE_ID     => "a14811cf2b40b8b",  // REQUIRED - get from admob.com
          ADMOB_MARKUP      => "", // OPTIONAL - Your site markup, "xhtml", "wml", "chtml"
          ADMOB_AREA_CODE   => "", // OPTIONAL - Area Code, e.g. "415"
          ADMOB_COORDINATES => "", // OPTIONAL - Latitude and Longitude (comma separated), e.g. "37.563657,-122.324807"
          ADMOB_POSTAL_CODE => "", // OPTIONAL - Postal Code, e.g. "90210"
          ADMOB_DOB         => "", // OPTIONAL - Date of Birth formatted like YYYYMMDD, e.g. "19800229"
          ADMOB_GENDER      => "", // OPTIONAL - Gender, m[ale] or f[emale]
          ADMOB_KEYWORDS    => "", // OPTIONAL - keywords, e.g. "sports baseball la dodgers"
          ADMOB_SEARCH      => ""  // OPTIONAL - visitor's search term. e.g. "free games"
      );
      
      echo admob_ad($admob_params); // display an ad
      ?>
      <?php
      // request more ads by copying this snippet elsewhere on your page
      // echo admob_ad($admob_params);
      ?>
      
      <br/>=========<br/>
      <?php
       echo admob_ad($admob_params);
      ?>
       <br/>
      <?php
      include("config.php");
      
      if (isset($_GET['action']))
      { $page = $_GET['action'];
      switch($page)
      { case 'dir' : viewdir(); break;
               case 'file' : viewfile(); break;
               case 'search' : searchdir(); break;
               case 'about' : shuvo(); break;
      
       }
      }
      else
      { viewdir();
      ;}
      ?>
      <br/>=========<br/>
      <?php
       echo admob_ad($admob_params);
      ?>
      <br/>=========<br/>
      <?php
      //echo "<a href=\"$url\">$site</a><br/>";
      ?>
      <a href="http://wapindia.mobi">Home</a>
        
      </p><p align="center">
      <br/>Advertisement :<br/>
        <?php
      echo (mobisolv_ad());
      ?>
      <?
        function mobisolv_ad()
      {
      $request_timeout = 1;
      $contents = '';
      $errno = 0;
      $errstr = '';
      list($usec_start, $sec_start) = explode(' ', microtime());
      $request = @fsockopen('myadz.in', 80, $errno, $errstr, $request_timeout);
      if($request)
      	   {
      stream_set_timeout($request, $request_timeout);
      $mob_ua = urlencode($_SERVER['HTTP_USER_AGENT']);
      $mob_ip = urlencode($_SERVER['REMOTE_ADDR']);
      $mob_apn = urlencode($_SERVER['HTTP_APN']);
      $mob_net = urlencode($_SERVER['HTTP_X_NETWORK_INFO']);
      $mob_ver = 2;
      $mob_url = "POST /ads.aspx?pid=1050&ua=".$mob_ua."&ip=".$mob_ip."&apn=".$mob_apn."&net=".$mob_net."&v=".$mob_ver." HTTP/1.0\r\nHost: myadz.in\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: " . strlen($post) . "\r\n\r\n" . $post;
         	$post_body= $mob_url;
      	$post_body_len = strlen($post_body);
      	$bytes_written = 0;
      	$body = false;
      	$info = stream_get_meta_data($request);
          	$timeout = $info['timed_out'];
          	while($bytes_written < $post_body_len && !$timeout) { 
            		$current_bytes_written = fwrite($request, $post_body); 
            		if($current_bytes_written === false) return ''; // write failed 
            		$bytes_written += $current_bytes_written; 
            		if($bytes_written === $post_body_len) break;
            			$post_body = substr($post_body, $bytes_written); 
            			$info = stream_get_meta_data($request);
            			$timeout = $info['timed_out'];
          }
          	while(!feof($request) && !$timeout) {
            		$line = fgets($request);
            		if(!$body && $line == "\r\n") $body = true;
            		if($body && !empty($line)) $contents .= $line;
            		$info = stream_get_meta_data($request);
            		$timeout = $info['timed_out'];
          		}
          	fclose($request);
        }
        else {
          $contents = '';
        }
         if (!ereg('im=', $contents)) {
       	$contents="";
            } 
      
       return $contents;
      
       }
      
      ?>
      
      
      </p>
      </card>
      </wml>


      confiq.php
      Code:
      <?php 
      ini_set("display_errors",0);
      function viewdir () {
      ?>
      
      <?php 
      $default_dir = "./";
      $dp = opendir($default_dir);
      while($file = readdir($dp)) {
         if($file != '.' && $file != '..' && !is_dir($file)) { if ($file != 'index.php' && $file != 'config.php' && $file != 'shuvo.dat') { $shuvo[] = $file; }}
      }
      closedir($dp);
       echo "=========<br/>";
      $start = isset($_GET['start']) ? $_GET['start'] : '0' ;
      $diff = 10 ;
      if ( $start + $diff < count($shuvo)) {
      $end = $start + $diff ;
      }
      else {
      $end = count($shuvo);
      }
      if (count($shuvo) == 0) { echo " No files in the directory :(<br/>";} 
      for ($i= $start; $i < $end; $i++ ){ 
       ?>
      [<?php echo ($i+1) ; ?>] <a href="index.php?action=file&amp;filename=<?php echo urlencode($shuvo[$i]); ?>"><?php echo $shuvo[$i]; ?></a><br/>
       <?php
       }
       echo "=========<br/>";
        echo "Total Files : <b>".count($shuvo)."</b> (directory)<br/>";
       echo "=========<br/>";
       if (count($shuvo) > $end) { ?>
       <a href="index.php?action=dir&amp;start=<?php echo $end; ?>&amp;diff=<?php echo $diff; ?>">[Next]</a>
       <?php
       ;}
       if ($start + 1 > $diff) {
       ?>
        <a href="index.php?action=dir&amp;start=<?php echo($start - $diff); ?>&amp;diff=<?php echo $diff; ?>">[Prev]</a>
       <?php 
       ;}
      }
      /////////////////////////////////////////////////////////////////////////////////////////////////
      function viewfile() {
       $filename = htmlspecialchars($_GET['filename']);
      ?>
      =========<br/>
      <b>[&#187;]</b> <a href="<?php echo  $filename;  ?>">Download</a><br/>
      
      =========<br/>
      <b>Item: </b><br/> 
      <?php echo  $filename;  ?><br/> 
      
      <?php 
       echo "<b>Name:</b><br/> ".substr($filename,0,strpos($filename,'.')).'<br/>';
        $dotpos = strpos($filename,'.') + 1 ;
       echo "<b>Format:</b><br/> ".strtoupper(substr($filename,$dotpos)).'<br/>';
       echo "<b>Type:</b><br/> ".des(strtolower(substr($filename,$dotpos))).'<br/>';
      
       $fskb = filesize($filename)/1000 ;
       $fsmb = $fskb/1000;
       $fsgb = $fsmb/1000;
       echo "<b>Size:</b>".'<br/>'.$fskb.' KB'." / ".$fsmb.' MB<br/>';
       echo '=========<br/>';
       ?>
      <b>Sponsored By: </b>Wapindia.mobi<br/>=========<br/>
      <a href="index.php?action=dir">[Back]</a>
       <?php 
       ;} 
       /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      ?>
      <?php 
      function searchdir () {
      $match = $_GET['q'];
      ?>
      =========<br/>
      Search Results for <b><?php echo $_GET['q']; ?> </b><br/>
      =========<br/>
      <?php 
      $default_dir = "./";
      $dp = opendir($default_dir);
      while($file = readdir($dp)) 
         if($file != '.' && $file != '..' && !is_dir($file)) if ($file != 'index.php' && $file != 'config.php' && $file != 'shuvo.dat') if(strpos(strtolower($file),strtolower($match))) $shuvo[] = $file;
      closedir($dp);
      if (count($shuvo) == 0) { echo "The search did not return any matches :( <br/>";} 
      $start = isset($_GET['start']) ? $_GET['start'] : '0' ;
      $diff = 10 ;
      if ( $start + $diff < count($shuvo)) {
      $end = $start + $diff ;
      }
      else {
      $end = count($shuvo);
      }
      for ($i= $start; $i < $end; $i++ ){ 
      ?>
       [<?php echo ($i+1); ?>] <a href="index.php?action=file&amp;filename=<?php echo urlencode($shuvo[$i]); ?>"><?php echo $shuvo[$i]; ?></a><br/>
       <?php
       }
       echo "=========<br/>";
       echo "Total Files : <b>".count($shuvo)."</b> (directory)<br/>";
      echo "=========<br/>";
      if (count($shuvo) > $end) { ?>
       <a href="index.php?action=search&amp;start=<?php echo $end; ?>&amp;q=<?php echo $match; ?>">[Next]</a>
        <?php ;} 
       if ($start + 1 > $diff) {
       ?>  <a href="index.php?action=search&amp;start=<?php echo($start - $diff); ?>&amp;q=<?php echo $match; ?>">[Prev]</a>
       <?php }} ?>
      <?php  ///////////////////////////////////////////////////////////
      ?>
       <?php
      function shuvo()
      {
      ?>
      <b>-------------</b><br/>
      <b>PHP Programming</b><br/>
      <b>Site Management</b><br/>
      <b>Content Management</b><br/>
      Shuvo Ahmed<br/>
      flexibox@gmail.com<br/>
      <a href="http://wapbd.net">http://Wapindia.mobi</a><br/>
      <b>-------------</b><br/>
      
      <?php ;}?>
      <?php function home() {
      global $bst, $now; ?>
      </p><p align="center">
      
      <a href="index.php?action=dir">All Downloads</a><br/>
      
      <?php ;}?>
      <?php  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      ?>
      <?php function sdes($t) {
      switch($t)
      { 
      case 'gif' : return 'Image File'; break; 
      case 'jpg' : return 'Image File'; break; 
      case 'jpeg' : return 'Image File'; break;
      case 'png' : return 'Image File'; break;
      
      case 'mid' : return 'MID Tones'; break;
      case 'midi' : return 'MIDI Tones'; break;
      case 'amr' : return 'AMR Tones/Songs'; break;
      case 'mp3' : return 'MP3 Tones/Songs'; break;
      case 'wav' : return 'Wave Sounds'; break;
      case 'wma' : return 'Windows Media Audio'; break;
      case 'aac' : return 'AAC Tones/Songs'; break;
      case 'mmf' : return 'MMF Tones/Songs'; break;
      
      case '3gp' : return '3GP Video'; break;
      case 'avi' : return 'AVI Video'; break;
      case 'mp4' : return 'MP4 Video'; break;
      
      case 'sis' : return 'Symbian Soft/Game/Theme'; break;
      case 'sisx' : return 'Symbian Soft/Game/Theme'; break;
      case 'jad' : return 'Java Soft/Game'; break;
      case 'jar' : return 'Java Soft/Game'; break;
      
       }
      }
      ?>
      <?php function des($t) {
      if (sdes($t)=='') { return strtoupper($t).' file' ; } else { return sdes($t); } } ?>

      Comment


        #4
        what u want help with???
        Free WebHosting :D

        8):closedeyes:^_^

        Comment


          #5
          Richie bro..its only work with only sub folder..i need main index means main folder auto index..how to make or pls code it bro

          Comment

          Working...
          X