Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js][php] Problem ze spacjami
DANGER
post 11.12.2006, 19:09:06
Post #1





Grupa: Zarejestrowani
Postów: 43
Pomógł: 0
Dołączył: 23.11.2006

Ostrzeżenie: (0%)
-----


  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!
Go to the top of the page
+Quote Post

Posty w temacie
- DANGER   [js][php] Problem ze spacjami   11.12.2006, 19:09:06
- - macek   przy zapisywaniu zdjęć na serwer ZAWSZE ...   13.12.2006, 15:03:46


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 06:26