Jump to content
php.lv forumi

waplet

Reģistrētie lietotāji
  • Posts

    1,373
  • Joined

  • Last visited

Everything posted by waplet

  1. waplet

    image resize

    <?php $staly = $HTTP_POST_FILES['bil']['name']; if ($staly !='' && substr($staly, strlen($staly)-3, 3) == 'jpg' ){ // pārbaudam, vai ir saņemts pieprasījums $dirr = "liels"; //direktorija, uz kuru sūta oriģinālo bildi $dirrr = "mazs"; //direktorija, uz kuru sūta samazināto bildi $cels1= $dirr."/".$HTTP_POST_FILES['bil']['name']; //pinls ceļš uz bildi kopā ar bildes nosaukumu copy($HTTP_POST_FILES['bil']['tmp_name'], $cels1); // pārkopē lielo bildi uz direktoriju $cels= $dirrr."/".$HTTP_POST_FILES['bil']['name']; //pinls ceļš uz bildi kopā ar bildes nosaukumu $bildinfo = getimagesize($cels1); // nolasam bildes info $s_width = $bildinfo[0]; // bildes platums $s_height = $bildinfo[1]; // bildes augstums if ($s_width > $s_height){ // pārbauda, vai bilde ir horizontāli $murgs = $s_width / 50; // max bildes platums $s_width = $s_width / $murgs; // aprēķina bildes apjomus $s_height = $s_height / $murgs;// aprēķina bildes apjomus } else{ $murgs = $s_height / 50; // max bildes augtums $s_width = $s_width / $murgs; // aprēķina bildes apjomus $s_height = $s_height / $murgs; // aprēķina bildes apjomus } ini_set("memory_limit", "42M"); //uzliekam lielāku atmiņas apjomu, lai darbotos ar lielām bildēm $src_img = imagecreatefromjpeg($cels1); // iesūc atmiņā nesamazinātu bildi $dst_img = imagecreatetruecolor($s_width,$s_height); // iesūc atmiņā samazinātās bildes izmērus imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $s_width, $s_height, $bildinfo[0], $bildinfo[1]); // samazina bildi imagejpeg($dst_img,$cels); //izveido samazināto bildi imagedestroy($src_img); //nobeidz bildes procesu } ?> <form action="" method="post" enctype="multipart/form-data"> <input type="file" name="bil" /><br /> <input type="submit" value="aiziet" /> </form> <c> Mārtiņš gfx-dream.lv
  2. Pameklē kādu watermark skriptu!
  3. v3rbo , neredzi foks to pašu linku iedevis!
  4. http://64.233.183.104/search?q=cache:foeoy...lient=firefox-a Te ķīp saglabāts ir 24 augustā , bet arī mysql rakstīts!
  5. lol tas ir cipheris , nokodēts + ar zend :)
  6. Muweb gribi nonest?Vai tikai izpētīt iekšas?
  7. PIe validatora ,neko tādu kas varētu stiept nerādīju , tikai doctype un html tur nav vajadzīgs!
  8. Skaties: 1. http://waplet.oo.lv 2. http://waplet.oo.lv/1.php
  9. Jā,bet kāpēc inklūdojot ir izmētāts pa visām pusēm , bet parasti atverot nekas tāds nav?
  10. Jā bet tā arī neviens nepateia kāpēc izmētā, bet prasti 1.php nekas tāds nava!
  11. Mjā vēlviens prikols : http://waplet.oo.lv ir izmētāts , bet kad parasti 1.php atver ir normāli? index.php <html> <head> <title>Mans pirmo kodu webs!</title> <!-- right click end --> <style type="text/css"> body {color: #FFFFFF; font-family: Tahoma; font-size: 11px;background-image:url('images/bgnew.png');background-repeat: repeat; } <!-- img { border: 0; } --> a { color: #FFFFFF; } a:visited { color: #FFFFFF; } table.bordered { border:dotted #FFFFFF;border-width: 1px} </style> <body> <?php include('header.php'); ?> </body> header.php <style> font {font-family: Verdana;font-size: 11px; font-weight: bold;color: #FFFFFF} a {color: #FFFFFF} a.visited {color: #FFFFFF} a.hover {color #CCCCCC} </style> <table class="bordered" width="450" border="0" align="center" valign="center" cellpadding="5" cellspacing="1 px"> <tr> <th background="images/back.gif" valign="middle" align="center" width="85" height="40"><font><a href="?kods=1">Pirmais kods</a></font></th> <th background="images/back.gif" valign="middle" align="center" width="85" height="40"><font><a href="?kods=2">Otrais kods</a></font></th> <th background="images/back.gif" valign="middle" align="center" width="85" height="40"><font><a href="?kods=3">Tresais kods</a></font></th> <th background="images/back.gif" valign="middle" align="center" width="85" height="40"><font><a href="?kods=4">Ceturtais kods</a></font></th> <th background="images/back.gif" valign="middle" align="center" width="85" height="40"><font><a href="?kods=5">Piektais kods</a></font></th> </tr> </table> <center> <?php switch($_GET['kods']){ case '1': include('1.php'); break; case '2': include('2.php'); break; case '3': include('3.php'); break; case '4': include('4.php'); break; case '5': include('5.php'); break; default: include('1.php'); break; } ?> </center> 1.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style> /** * (c) mefisto */ /* css reset */ html, form, fieldset, input{ margin: 0; padding: 0; } fieldset, input{ border: 0; } /* reset done */ body{ margin: 0 10em; padding: 5em 0; } form.search fieldset{ padding-left: 26px; background: url(./11_03.gif) no-repeat; } form.search input.query{ background: url(./11_04.gif) repeat-x; height: 18px; padding: 4px 10px 3px; float: left; color: #444; font: normal 0.75em Verdana, sans-serif; } </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Searchs</title> <!--<link rel="stylesheet" href="layout.css" type="text/css" media="screen" charset="utf-8" /> --> </head> <body> <form class="search" method="post" action="?kods=1"> <fieldset> <input type="text" class="query" name="vards" /> <input type="image" alt="ok" src="11_05.gif" /> </fieldset> </form> </body> </html>
  12. Nu ja uzservera , neviens no piedāvātajiem failiem kačāt , neatrodas , Serveris ir kā izplatītājs!
  13. html kods: <html> <body> <table> <th height="100%" valign="bottom"><form method="post" > <img src="11_03.gif" height="25" /> <input style="background:url(11_04.gif); border:solid 0px; max-width:15 px; font-family:Tahoma 11px" type="text" name="vards" height="25" maxlenght="15" /> <img src="11_05.gif" height="25" align="bottom"/> </form></th> </table> </body> </html> Izskatās šādi : http://waplet.oo.lv/ok/1.php Es gribētu lai viss būtu vienā līnījā kā to panākt?
  14. if( $grupa = "4x4"{ echo "$4x4 tabula"; } elseif($grupa = "8x8"{ echo "$8x8 tabula"; }
  15. tas nozīmē , to ka tu izpildi , sql vaicājuma koda , savādāku versiju , tas nozimē, tu vari uzzināt daudz ko citu , ko tev nevajag zināt!
  16. <?php $ffmpegpath = "/usr/bin/ffmpeg"; //usually this $input = "./robot.avi"; $output = "./robots.flv"; $command = "$ffmpegpath -i $input -acodec mp3 -ar 22050 -ab 32 -f flv $output"; //-ar 22050 -ab 32 -f flv -s 320x240 @exec( $command, $ret ); if(!file_exists($output) or @filesize($output)==0) echo "Did not convert the file"; ?>
  17. priekš tam var uztaisīt pārkonvertētāju , un kas parkonvertēs uz vienu formātu!
  18. w3schoollaa ir "leetakais" uploados , kas vien uzrakstāms!
  19. kad uploado lietotājs , varetu uztaisīt tā ka bildi nosauc , tā , kāds lietotājam niks , tad no db viennkārši tā piem: $userbilde = $username echo "<img src=\"userimages\"."$userbilde".".jpg" />";
  20. eh jā neidomājos par ! not equal :D , bet labi paldies :) Vēlvienkāršāk būtu ja rakstītu nevis elseif , bet gan else un viss! :) Vai arī tā būtu koda kļuda?
  21. nevarētu ečot vienkarši to $_GET['i']?
×
×
  • Create New...