Jump to content
php.lv forumi

blackhalt

Reģistrētie lietotāji
  • Posts

    763
  • Joined

  • Last visited

Everything posted by blackhalt

  1. Vecs u neoptimizēts, bet darbojās: <?php // bildes echo"<form enctype=\"multipart/form-data\" action=\"bildes.php?action=done\" method=\"post\">"; //upload process echo'<br/>Panjemt bildi:<br /><input type="file" name="file" /><br />'; if(isset($file)){ // K|NG uploaders $liktne='/home/virtual/***/fst/var/www/html/bildes';// tava direktorija $f_nos='file'; if(substr($liktne,-1)!='/'){ $liktne.='/'; } if(!is_dir($liktne)){ die("<b>$liktne</b> nav pareiza direktorija<br /><a href=\"bildes.php\">Iet atpakalj</a>"); } $kurlikt=$liktne.$_FILES[$f_nos]['name']; $lol=$_FILES[$f_nos]['name']; if(empty($_FILES[$f_nos]['name'])){ @unlink($_FILES[$f_nos]['tmp_name']);// die("A taa nevar! <a href=\"bildes.php\">Iet atpakalj</a>"); } if(file_exists($kurlikt)){ @unlink($_FILES[$f_nos]['tmp_name']);// die("Nevar, jo fails $lol jau ir! <a href=\"bildes.php\">Iet atpakalj</a>"); } move_uploaded_file($_FILES[$f_nos]['tmp_name'],$kurlikt); @unlink($_FILES[$f_nos]['tmp_name']);// // celjsh : $file="/home/virtual/***/fst/var/www/html/bildes/$lol"; $file2="/home/virtual/***/fst/var/www/html/bildes/m_$lol"; if(!copy($file,$file2)) { die("nevaru nokopeet $file...\n"); } chmod($file,0644); chmod($file2,0644); $bilde="$file2"; function resize_jpg($img,$w,$h) { $thumb=imagecreatetruecolor($w, $h); $image=ImageCreateFromJpeg($img); $imagedata=getimagesize($img); imagecopyresized($thumb, $image, 0, 0, 0, 0, $w, $h, $imagedata[0], $imagedata[1]); imagejpeg($thumb, $img, 100); echo'Mazā bilde ir gatava!'; } // JPG function resize_png($img,$w,$h) { $thumb=imagecreatetruecolor ($w, $h); $image=ImageCreateFromPng($img); $imagedata=getimagesize($img); imagecopyresized($thumb, $image, 0, 0, 0, 0, $w, $h, $imagedata[0], $imagedata[1]); imagepng($thumb, $img); echo'Mazā bilde ir gatava!'; } // PNG $size=getimagesize ($bilde); $a=$size[0]/4; $b=$size[1]/4; $z=$size[2]; if($z=='2'){ resize_jpg($bilde,$a,$b); } if($z=='3'){ resize_png($bilde,$a,$b); } } switch($action){ case'done':{ echo'<br /><b>Lielā bilde gatava!</b> '; echo"<a href=\"../bildes/$lol\"><img src=\"../bildes/m_$lol\" alt=\"\" /></a><br />"; break; } default:{ }} echo'<br /> <input type="submit" name="Submit" value=" Akceptēt " /> </form><hr />'; // eof ?>
  2. Firefox ir tāda ekstensija: http://clav.mozdev.org/#tbx un tur podziņa ar ko var atslēgt Meta redirektus
  3. Kapēc gan frfxam būtu kaut kas jāwrapo, ja textā nav nevienas atstarpes? Lieto MSIE! Windows iepējas. ugunssienas antiviirussus turbo busterus antyspai cliinerus ... ... :D
  4. blackhalt

    404

    mhm vai arī redirektē uz to lapu no kurienes nākts ;)
  5. Nu tad tagad tikai atliek noskaidrot kādēļ MSIE nepareizi attelo PNG bildes.
  6. http://3a3-interactive.net/php_reference/
  7. Tā bilde tev ir puscaurspīdīga un to MSIE nesaprot. PNG
  8. <?php $sk='01'; if(eregi("^([0-9]){1,2}$",$sk)){ echo 'ir'; }else{ echo 'nav'; } ?>
  9. blackhalt

    eclub.lv

    ghe, nemaz nepaskatījos uz datumu :D
  10. blackhalt

    eclub.lv

    Kādi ir kļūdu paziņojumi?
  11. ~ <style type="text/css"> .ju{ background-color: #ffedc6; } </style> ... ... <div class="ju"> <table> <tr onmouseover="a=this.style.backgroundColor; this.style.backgroundColor='#f00'" onmouseout="this.style.backgroundColor=a;"><td>1234567890</td></tr> </table> </div> ... ...
  12. ģenerē tekstus kā bildes :)
  13. <?php echo implode('',file('http://google.lv')); ?>
  14. Diemžēl iekš /var/www/ serveris neljauj ielādēt caur FTP: STOR .htgroup 550 .htgroup: Permission denied (tas pats par .htpasswd) Bet nomainit CHMODU uz 777 www direktorijai jau serveris neljauj. 13851[/snapback] shas tev privātziņu aizsūtīšu ;)
  15. liec abus failus iekš: /var/www Ja hostings ir uz serveris.lv pateikšu sīkāk ;)
  16. Ārpus web direktorijas shitaa varētu izskatīties .htaccess fails: AuthUserFile /home/blabla/.htpasswd AuthGroupFile /home/blabla/.htgroup AuthName "Autorizaacija" AuthType Basic <Limit GET> require group jankapanka </Limit>
  17. nu saku konsolee ieraksti: # htpasswd -c /fails kaka New password: Re-type new password: Adding password for user kaka buus /fails : kaka:tUL/Fxwpa5z.A nu un to failu uzmet uz servera. Ā, laikam sapratu. Tev ir windows utt. Uz savas kastes vari uztaisīt to failu, ja tev ir apache. un no savas uzkopeet to failu uz to serveri.
  18. blackhalt

    index

    Tas laikam ir Notice errors. uzliec: <?php error_reporting(0); // ?>
×
×
  • Create New...