Pomoc - Szukaj - U¿ytkownicy - Kalendarz
Pe³na wersja: [js][php] Problem ze spacjami
Forum PHP.pl > Forum > Przedszkole
DANGER
  1. <?php
  2. / Script Source: CodeLifter.com
  3. // Copyright 2003
  4. // Do not remove this notice.
  5.  
  6. // SETUPS:
  7. // ===============================
  8.  
  9. // Set the horizontal and vertical position for the popup
  10.  
  11. PositionX = 100;
  12. PositionY = 100;
  13.  
  14. // Set these value approximately 20 pixels greater than the
  15. // size of the largest image to be used (needed for Netscape)
  16.  
  17. defaultWidth = 500;
  18. defaultHeight = 500;
  19.  
  20. // Set autoclose true to have the window close automatically
  21. // Set autoclose false to allow multiple popup windows
  22.  
  23. var AutoClose = true;
  24.  
  25. // Do not edit below this line...
  26. // ================================
  27. if (parseInt(navigator.appVersion.charAt(0))>=4){
  28. var isNN=(navigator.appName=="Netscape")?1:0;
  29. var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
  30. var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
  31. var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
  32. function popImage(imageURL,imageTitle){
  33. if (isNN){imgWin=window.open('about:blank','',optNN);}
  34. if (isIE){imgWin=window.open('about:blank','',optIE);}
  35. with (imgWin.document){
  36. writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
  37. writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
  38. writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
  39. writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
  40. writeln('width=100-(document.body.clientWidth-document.images[0].width);');
  41. writeln('height=100-(document.body.clientHeight-document.images[0].height);');
  42. writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
  43. writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
  44. writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
  45. if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
  46. else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
  47. writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
  48. close();
  49. }}
  50.  
  51. </script>
  52. ?>



to skrypt ktory pobralem z sieci na dopasowanie okna do wymiarow obrazka

  1. <?php
  2. <a href=java script:popImage('foty/".$nick."_1.jpg','".$nick."')><img src='foty/".$nick."_1m.jpg'' border=0></a>
  3. ?>


to moj kod na stronie zeby wyswietlic miniature - link do orygianlnego zdjecia


problem polega na tym ze gdy w nicku jest spacja to js juz tego nie lapie.....i nie da sie otworzyc obrazka....

<a href=java script:popImage('foty/Jarek pol_1.jpg','Jarek pol')><img src='foty/Jarek pol_1m.jpg'' border=0></a>


prosze o pomoc i z gory dziekuje!
macek
przy zapisywaniu zdjęć na serwer ZAWSZE usuwaj spacje (i inne niebezpieczne znaki:P ), lub choć zamieniaj je na _
To jest wersja lo-fi g³ównej zawarto¶ci. Aby zobaczyæ pe³n± wersjê z wiêksz± zawarto¶ci±, obrazkami i formatowaniem proszê kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.