Jump to content
php.lv forumi

ka var sapaarot?


zopiks

Recommended Posts

pasakiet kaads, kaa es varu shito

 

<?
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">";

include("../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")
	{
	$file_array[] =  $file;
	}
}
$file_count = count ($file_array);
sort ($file_array);
?> 
<wml>
<card id="card1" title="<? echo $conf["site_name"] ?>"> 
<p mode="nowrap">
       <? echo "<a href=\"../index.php\">Home</a><br/><br/>"; ?>
	<?

	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)<br/>";
				$total = $total + filesize($file_name);
				}
			}

		if (($file_count > 0) AND ($page != 0))
			{
			// previous button
			$prev_page = $page -1;
			echo "<br/><a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Prev</a><br/>";
			}


		if (($file_count > 0) AND ($last_record < $file_count))
			{
			// next button
			$next_page = $page + 1;
			echo "<br/><a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Next</a><br/>";
			}
		echo "<br/>Mapē:<br/>$file_count ";
		if ($file_count == 1)
			{echo "fails.";}
		else
			{echo "faili.";}

		echo " (" . round($total/1024,1) . "kb)";
		echo "<br/><a href=\"../index.php\">Home</a>";
		}
	closedir($dp);
	?>

</p>
</card> 
</wml> 

 

saparot ar shito

$myimg = "http://";
list($width, $height, $type, $attr) = getimagesize($myimg);
echo "Image size: $width x $height";

nu protams taa lai paraadiitos bildes nosaukums, lielums un izmeers! vai arii lai taa notiktu, un vai to var vispaar izdariit?

Link to comment
Share on other sites

pasakiet kaads, kaa es varu shito ...

saparot ar shito

16915[/snapback]

ar pārošanu.

moš tomēr nodefinē ko tu gribi uztaisīt un kurā vietā rodas problēma, nevis iedod divus koda gabalus un prasi kā kaut ko no viņiem uztaisīt.

 

še naglas, še maize - sapāro. un tolks kāds maizē naglas sadzīt?

Link to comment
Share on other sites

Lai sapārotu, teiksim, iesākumam izmitini jamos vienā failā un uzliec uz servera. Pēc dažām dienām, kad šie jau būs tuvāk iepazinušies, mēģini failu palaist.

 

Ja redzi erroru, paskaties, pameklē kļūdu. Ja kaut ko citu, tad padomā, ko īsti tu gribi panākt.

Link to comment
Share on other sites

×
×
  • Create New...