Jump to content
php.lv forumi

Palidziet ar skriptu


xboxx

Recommended Posts

Tatad man ir WAP ielazu skripts HTML versijaa.

Un man vins name liek tadu pasu ka faila nosaukums, tas nu buutu taa...

Vai es varetu faila nosakumam (TIKAI) uztaisit replace no "_" uz parasto atstarpi " "

 

Piemeram url http://test.com/bla_bl.zip uz http://test.com/bla bl.zip kur noskaukums butu nevis

 

bla_bl.zip bet gan bla bl.zip

Skripts:

<!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" lang="en"><head>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<title>
<?php
error_reporting(E_ALL & ~E_NOTICE); 
 include ('../../../title.php');
?>
</title>
<link rel="stylesheet" type="text/css" href="../../../style/stil.css" />
</head>
<!--Nastase Georgica-->
<body>
<!--includere data-->
<div align="center">
<div class="pDate">
<?php
 include ('../../../date.php');
?></div></div>
<br/>
<!--includere rotatie logo-->
<div align="center">
<div class="pLogo">
<img src="../../../lrotate.php" alt=""/></div></div>
<br/>
<!--link-uri navigation-->	
<div align="center">
<div class="pText">
Navigation
</div>
</div>
<br/>
<div align="center">
<div class="pBody">
	<img src="../../../hrotate.php" alt=""/><br/><br/>
<!--includere in zona descrierii-->
<div align="center">
<div class="pDown">						
<?php  
include("../../../settings.php");
$page = $_GET['page'];
$self = $_SERVER['PHP_SELF'];
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")
	{
	$file_array[] =  $file;
	}
}
$file_count = count ($file_array);
sort ($file_array);
?> 		
<?php
	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> <br/>".round(filesize($file_name)/1024,1)."kb<br/>\n";
				$total = $total + filesize($file_name);
				}
			}		
		if (($file_count > 0) AND ($page != 0))
			{
			// buton intoarcere
			$prev_page = $page -1;
			echo "<br/><a href=\"$self?page=$prev_page\">Back</a><br/>\n";
			}			
		if (($file_count > 0) AND ($last_record < $file_count))
			{
			// buton inaintare
			$next_page = $page + 1;
			echo "<a href=\"$self?page=$next_page\">Next</a><br/>\n";
						$next_page = $page + 5;
			echo "<a href=\"$self?page=$next_page\">Jump 5 pages</a><br/>\n";
										$next_page = $page - 1;
			echo "<a href=\"$self?page=$next_page\">Back 1 page</a><br/>\n";
			}
// introducere contoar produse		
		echo "$file_count ";
		if ($file_count == 1)
			{echo "Product";}
		else
			{echo "Products";}				
		//echo " (" . round($total/1024,1) . "kb)\n";

		}
	closedir($dp);
?>
   </div>
</div>
	<br/>
	  
	<img src="../../../img/go.gif" alt="" width="10" height="7" />  <a href="../../../index.php">Main Page</a>
</div>
</div>
<br/>
<!--link-uri index-->
<div align="center">
<div class="pText">
Site Index
</div>
</div>
<br/>
<div align="center">
	<div class="pBody">
	<img src="../../../frotate.php" alt=""/><br/><br/>
	  
	<img src="../../../img/go.gif" alt="" width="10" height="7" />  <a href="../../../../help.php">Help</a>
</div>
</div>
<!--includere user si hits-->
<br/>
<div align="center">
<div class="pUser">
User:
<?php
$browser = $_SERVER['HTTP_USER_AGENT'];
	echo $browser;
?>
</div>
</div>
<div align="center">
<div class="pCopy">
<?php
 include ('../../../copy.php');
?>
</div>
</div>
</body>
</html>

Skripts:

Edited by xboxx
Link to comment
Share on other sites

×
×
  • Create New...