Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

2 Stron V   1 2 >

Jarod
Napisane: 24.11.2008, 19:10:34





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat(code46 @ 24.11.2008, 19:07:43 ) *
Jak zapisać zamianę więcej niż jednego tabulatora do dowolny inny znak?


Analogicznie
  1. <?php
  2. preg_replace(array('/(r?\n){2,}/', '/ {2,}/', '/[[:blank:]]{2,}/'), array("<enter>", '<spacja>', '<tab>'), $tekst)
  3. ?>
  Forum: Przedszkole · Podgląd postu: #540225 · Odpowiedzi: 13 · Wyświetleń: 2 878

Jarod
Napisane: 23.11.2008, 20:13:46





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat
PHP has a default limit of 100 before it dies:

Fatal error: Maximum function nesting level of '100' reached, aborting!

Edit: You can change the limit with ini_set('xdebug.max_nesting_level', 100000);, but if you go above about 1150 iterations PHP crashes:

[Fri Oct 24 11:39:41 2008] [notice] Parent: child process exited with status 3221225477 -- Restarting.


źródło: http://stackoverflow.com/questions/233013/...-deep-recursion
  Forum: Przedszkole · Podgląd postu: #539883 · Odpowiedzi: 1 · Wyświetleń: 4 700

Jarod
Napisane: 19.11.2008, 16:17:44





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

  1. <?php
  2. echo Config::${'SystemD' . 'other'}
  3. ?>


questionmark.gif
  Forum: Przedszkole · Podgląd postu: #538432 · Odpowiedzi: 11 · Wyświetleń: 1 966

Jarod
Napisane: 19.11.2008, 15:58:51





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

  1. <?php
  2. $a = 'y';
  3. $yz = "TEST";
  4.  
  5. echo ${$a.'z'};
  6. ?>
  Forum: Przedszkole · Podgląd postu: #538423 · Odpowiedzi: 11 · Wyświetleń: 1 966

Jarod
Napisane: 16.09.2008, 17:44:05





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat(code46 @ 16.09.2008, 16:41:29 ) *
Jak mogę przerwać wykonywanie pętli foreach?


break
  Forum: Przedszkole · Podgląd postu: #516773 · Odpowiedzi: 3 · Wyświetleń: 1 317

Jarod
Napisane: 30.06.2008, 18:22:32





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

strip_tags()

http://www.7plus.pl/kurs-tworzenia-strony/...ieczenstwo.html
  Forum: Przedszkole · Podgląd postu: #488094 · Odpowiedzi: 3 · Wyświetleń: 2 621

Jarod
Napisane: 25.04.2008, 15:13:54





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

W 90% przypadków JOIN jest wydajniejsze. Daj przed każdym zapytaniem explain i sam oceń.
To się przyda: http://0day.pl/index.php/archives/12
  Forum: Przedszkole · Podgląd postu: #465891 · Odpowiedzi: 1 · Wyświetleń: 591

Jarod
Napisane: 30.04.2008, 14:23:58





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Potrzebuję sposobu podobnego do tego zaprezentowanego wyżej ale bez konieczności rozbijania godzin na minuty.
Tzn, że z bazy pobieram dwie godziny np:

$a = '16:32';
$b = '07:10';

Chcę uniknąć używania explode() w wiadomych przyczyn. Macie jakiś pomysł? Bo do tej pory robiłem to tak:
  1. <?php
  2. $fResult = date("H.i", strtotime($aWTR['koniec_pracy'])) - date("H.i", strtotime($aWTR['poczatek_pracy']));
  3. ?>


Ale przy godzinach

07:45
16:15

wynik 8,7 a powinno być 8,5 godziny. Musiałbym wyciągnąć wartości setne i tą wartość odjąć od 100. Za dużo danych i to zbyt duże obciążenie.
  Forum: Przedszkole · Podgląd postu: #466773 · Odpowiedzi: 20 · Wyświetleń: 3 230

Jarod
Napisane: 20.03.2008, 17:34:40





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Może Ci się przyda ten artykuł
http://dev.mysql.com/tech-resources/articl...io.NET_2005.pdf
http://www.adefwebserver.com/DotNetNukeHEL...ion/Default.htm

pzdr
  Forum: MySQL · Podgląd postu: #455462 · Odpowiedzi: 2 · Wyświetleń: 1 198

Jarod
Napisane: 19.03.2008, 14:19:23





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat(siemakuba @ 19.03.2008, 01:04:31 ) *
Np. tu:
http://developer.mozilla.org/en/docs/Gecko_DOM_Reference
http://msdn2.microsoft.com/en-us/library/m...055(VS.85).aspx
Wrzucenie całości jQuery? To niewielkie obciążenie dla transferu - wersja spakowana to niecałe 30kb.
Czy umie tylko obrazki? Nie doceniasz winksmiley.jpg http://jquery.com/demo/thickbox/

pozdr.

Te strony to widziałem - myślałem, że jest coś więcej. Co do thickbox'a to także widziałem. Chciałem sam ugryźć temat. Dzięki za poświęcony czas winksmiley.jpg


Cytat(NoiseMc @ 19.03.2008, 05:22:46 ) *
Zobacz tutaj metode getHeight () i jak wykorzystuje ja w showLoading () moze pomoc z ustalaniem wysokosci okna

http://www.laurarosephotography.com/javasc.../Ajax/common.js
BTW ... po co echo-ujesz HTML ?


@NoiseMc: Ten skrypcik co podałeś, działa super w FF, jak się doda dodatkowo 30px do wyniku pageHeight (return pageHeight+30;) to działa dobrze w IE. Natomiast Opera kaszani się (na dole zostaje około centymetr białego paska - niezasłoniętego).

Co do drugiego Twojego pytania.. Kod, który podawałem skopiowałem ze skryptu, żeby nie pisać od początku. Trafiłem na skrypt, w którym dużo warunków za pomocą php jest sprawdzanych, a tam gdzie większość kodu generowana w php nie wychodzę z php tylko treść wyświetlam za pomocą echo - podobno lepiej wyświetlać strukturę (czyt. szybciej) dokumentu za pomocą echo niż otwierać i zamykać często sekcję php (<?php ?>).




ROZWIĄZANIE PROBLEMU:
index.php
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <meta http-equiv="Content-Language" content="pl" />
  5. <meta name="Robots" content="all" />
  6. <meta name="Pragma" content="no-cache" />
  7. <meta name="Cache-Control" content="no-store, no-cache, must-revalidate" />
  8.  
  9. <link rel="stylesheet" href="index.css" type="text/css" />
  10. <!--[if gte IE 6]><link rel="stylesheet" href="index_ie.css" type="text/css" /><![endif]-->
  11.  
  12. </head>
  13.  
  14. <div id="loader"></div>
  15. <!-- DODATKOWY BLOK POTRZEBNY DLA IE ŻEBY NIE IGNOROWAŁ MARGINESÓW !!! -->
  16. <div>
  17. <div id="content">
  18. What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Where does it come from? Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
  19. To jest przykładowy tekst
  20. </div>
  21. </div>
  22.  
  23. </body>
  24. </html>


index.css
  1. div#loader {position: fixed; top:0px; left:0px; background: #000000; width:100%; height:100%; z-index:9999;
  2. filter:alpha(opacity=60); -moz-opacity:0.6; opacity: 0.6;}
  3.  
  4. div#content {margin: 30px auto 0 auto; width: 200px; min-height: 500px; height: auto; color: #000000;
  5. background-color: red;}


index_ie.css
  1. body { margin: 0; padding:0; width: 100%; height:100%; overflow-y:auto;}
  2. html {overflow-x:auto; overflow-y:hidden;}
  3. * html div#loader {position:absolute;}



Działa pod FF, Operą i IE. Stawiam wirtualnego browarka dla tego kto potrafi mi wytłumaczyć, dlaczego ten dodatkowy blok <div> w kodzie index.php jest potrzebny, aby IE nie olewał marginesów? winksmiley.jpg

Pozdrawiam
  Forum: JavaScript · Podgląd postu: #454971 · Odpowiedzi: 24 · Wyświetleń: 3 978

Jarod
Napisane: 17.03.2008, 23:06:44





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat(code46 @ 17.03.2008, 23:03:23 ) *
Próbuję coś naskrobać i nawet pomysł fajny. Nawet uda mi się chyba wsadzić obrazek ładowania. Tylko mam trzy problemy:
1) Dla diva, który będzie zasłaniaj, w cssie muszę podać width i height ale ile podać, żeby zasłaniaj 100% strony w szerokości i wysokości i ani ciut więcej?


  1. width: 100%;
  2. height: 100%;


Ale pod IE 6.0 nie działa niestety.
  Forum: JavaScript · Podgląd postu: #454505 · Odpowiedzi: 24 · Wyświetleń: 3 978

Jarod
Napisane: 7.03.2008, 17:05:23





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

To zapytanie daje wynik taki jaki chcesz osiągnąć. Warunek: Klient który złoży co najmniej jedno zamówienie na cukierki musi złożyć co najmniej jedno na kartofle. Jeśli to Ci nie odpowiada to dwa zapytania i dodawaj sobie w php.



  1. SELECT DISTINCT c_id AS numer_zamowienia, (T1.c_suma + T2.k_suma) AS suma FROM ((SELECT id AS c_id, COUNT(id) AS c_suma FROM cukierki GROUP BY id) AS T1, (SELECT id AS k_id, COUNT(id) AS k_suma FROM kartofle GROUP BY id) AS T2) GROUP BY c_id ORDER BY suma DESC;
  Forum: MySQL · Podgląd postu: #450962 · Odpowiedzi: 10 · Wyświetleń: 2 041

Jarod
Napisane: 7.03.2008, 01:48:18





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat(szafran86 @ 7.03.2008, 01:40:14 ) *
No ok, ale jak tu się do bazy MySql dostać??

To co chcesz osiągnąć należy rozwiązać w inny sposób.
1. Sesje przechowujesz w bazie łącznie z czasem ostatniej aktywności danego użytkownika (np ja korzystam z własnego handlera sesji, mam do tego klasę)
poczytaj http://php.net.pl/manual/pl/function.sessi...ave-handler.php
2. Jeśli (aktualny czas - czas ostatniej aktywności) > od dopuszczalny czas to uznajesz że użytkownik zamknął stronę bez wylogowania i czyścisz taki wpis z bazy


pzdr
  Forum: Przedszkole · Podgląd postu: #450690 · Odpowiedzi: 5 · Wyświetleń: 1 263

Jarod
Napisane: 4.03.2008, 17:08:03





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat(ExPlOiT @ 4.03.2008, 17:05:51 ) *
I odwołanie się do diva czyli
  1. <div id="coś1">
  2. </div>

Co do marginesów to daj im parametr auto, jeżeli chodzi Ci o ustawienie strony po środku okna przeglądarki.


Chyba <div class="coś1">. Poza tym kolega nie napisał o środkowaniu tylko ogólnie o marginesach a wszyscy wiemy, że IE inaczej interpretuje marginesy.
  Forum: Przedszkole · Podgląd postu: #449708 · Odpowiedzi: 11 · Wyświetleń: 2 473

Jarod
Napisane: 4.03.2008, 17:02:38





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat(adiscan @ 4.03.2008, 16:59:22 ) *
Jak odwołać sie w css do diva o określonej nazwie? już zgłupiałem do konca...

mam np:
Kod
<div id="COŚ1">
</div>

lub

<div class="COŚ2">
</div>


div#COŚ1 {} lub #COŚ1{}
div.COŚ2 {} lub .COŚ2{}

EDIT: IE ogólnie ma problemy z marginesami. Masz dwa sposoby:
a) osobne style dla IE
cool.gif coś tyakiego:
  1. .cos
  2. {
  3. margin: 2px 0 6px 10px !important; /*to dla przeglądarek oprócz IE*/
  4. margin: 2px 0 6px 10px; /*IE oleje important i uwzględni ten zapis*/
  5. }
  Forum: Przedszkole · Podgląd postu: #449701 · Odpowiedzi: 11 · Wyświetleń: 2 473

Jarod
Napisane: 4.03.2008, 16:53:40





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Próbowałeś zamiast LEFT JOIN z INNER JOIN ?
  Forum: Bazy danych · Podgląd postu: #449696 · Odpowiedzi: 6 · Wyświetleń: 1 751

Jarod
Napisane: 4.03.2008, 14:09:17





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat
BLOB, TEXT Kolumna binarna lub tekstowa o rozmiarze nie przekraczającym 65 535 bajtów
MEDIUMBLOB, MEDIUMTEXT Kolumna binarna lub tekstowa o rozmiarze nie przekraczającym 16 777 215 bajtów
LONGBLOB, LONGTEXT Kolumna binarna lub tekstowa o rozmiarze nie przekraczającym 4 294 967 295 bajtów



http://home.pl/pomoc/2348
  Forum: Przedszkole · Podgląd postu: #449615 · Odpowiedzi: 3 · Wyświetleń: 1 198

Jarod
Napisane: 3.03.2008, 01:02:46





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat
DBISAM for Borland Delphi and C++ Builders and any development environment that can use ODBC for data access.


Cytat
DBISAM is a small, embedded database engine for use by developers within their applications. DBISAM is currently available for the Borland Delphi and C++Builder development environments as well as for any development environment that can use ODBC for data access.


Cytat
Overview

The following is an overview of DBISAM that includes a detailed list of all of it's features as well as a list of features not currently provided by DBISAM.

Productivity Features

* Compiles directly into your .EXE with no external .DLLs or configuration files needed
* Has a very small footprint, only 250-300k (base engine size, does not include data access component layer)
* Transparent single-user, multi-user usage, and client/server usage with no configuration changes required
* Complete source code for all utilities provided, and source code for DBISAM itself is available for an additional charge

Version Support

* Available for Delphi 5, 6, and 7 and C++Builder 5 and 6
* TDBISAMTable, TDBISAMQuery, TDBISAMDatabase, and TDBISAMSession components provided for all versions of Delphi (5, 6, and 7) and C++Builder (5 and 6)

International Support

* International support for over 100 languages
* Language and sorting information is stored in each table, no configuration files or special drivers needed

Database Engine Features

* Does not pre-allocate large blocks of memory and uses a very small amount of memory per table
* Primary and secondary indexes with support for case-insensitive, descending, and unique attributes
* Configurable index key compression
* Logical sequence numbers that show exact position of record in relation to total records, even with a range set
* Partial index key searches and ranges
* Accurate record counts, even with active ranges and/or filters
* Complete expression filter support including a filter optimizer, SUBSTRING, TRIM, LOWER, UPPER, POS, OCCURS, REPLACE, EXTRACT, CAST, ABS, ROUND, and IF functions, IN, LIKE, IS NULL, and BETWEEN extended operators.
* SQL SELECT, INSERT, UPDATE, DELETE CREATE TABLE, ALTER TABLE, DROP TABLE, CREATE INDEX, and DROP INDEX support, complete with a query optimizer, sub-selects, SUM MIN, MAX, COUNT, and AVG aggregate functions, SUBSTRING, TRIM, LOWER, UPPER, LENGTH, POS, OCCURS, REPLACE, EXTRACT, CAST, ABS, ROUND, and IF functions, IN, LIKE, IS NULL, and BETWEEN extended operators, both live and canned result sets, parameterized queries, queries on queries (INTO clause), in-memory query result sets, query progress events, SQL DDL scripts, and extended SQL syntax for DBISAM-specific features
* Shareable in-memory tables that are identical to disk-based tables and include streaming support
* All native Delphi field types (including BCD, BLOB, and auto-increment field types) supported
* Configurable block sizes for BLOBs
* NULL support
* Min, Max, and Required constraints and default values and character-case specifiers for fields
* Long field names and field and table descriptions for reference purposes
* Encryption of tables with passwords
* User-defined versioning of tables
* User-defined semaphore locking
* Automatic record locking and manual table locking
* Automatic change detection with configurable change detection policy - lazy or strict
* Complete cache management including intelligent read-ahead record buffering, index page buffering, BLOB block buffering, and optimized, serialized writes
* Automatic read-only support for CD-ROMs including optimized buffering
* Buffered transactions that allow tables to survive unexpected client workstation power-downs with little, or in most cases, no data corruption
* Built-in table verification and repair facilities complete with progress and log events
* Built-in table restructure facilities complete with progress and data conversion events
* Automatic free space recycling for data records, index pages, and BLOB blocks
* Built-in table optimization facilities complete with progress events
* Client/server version available with ability to switch between local and remote access with just a few property changes and support for low-bandwidth connections such as dial-up modems accessing servers across the Internet
* Default maximum file size of 4 gigabytes (per .DAT, .IDX, and .BLB file) with extended support for files up to 128 gigabytes
* Native import/export to and from delimited text files
* Full text indexing with support for optimized word searches that is fully-configurable per table with stop words, space characters, and include characters

Utilities Provided

* BDE Database Transfer Utility for transferring BDE-based tables to DBISAM format
* Database System Utility for creating, restructuring, browsing, searching, querying, reverse-engineering, and repairing tables interactively
* Server Administration Utility for remotely administering any server from any location, even over the Internet

Features Not Supported

* Stored procedures
* Batch moves
* Cached updates


Źródło: http://www.sunncity.com/Delphinux/softwareLicense.html
  Forum: Bazy danych · Podgląd postu: #449146 · Odpowiedzi: 3 · Wyświetleń: 2 829

Jarod
Napisane: 26.02.2008, 17:57:52





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat(.luki @ 26.02.2008, 17:54:28 ) *
W takim razie moglibyście polecić jakieś warte uwagi książki, które mogłyby mi nieco rozjaśnić?



Temat: Ksiazki
http://helion.pl/katalog/93,0,0.html

Poczytaj komentarze i coś wybierz.

Powodzenia
  Forum: Object-oriented programming · Podgląd postu: #447192 · Odpowiedzi: 7 · Wyświetleń: 2 456

Jarod
Napisane: 26.02.2008, 17:45:00





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Cytat(.luki @ 26.02.2008, 17:35:55 ) *
Mógłby mi ktoś wyjaśnić w jaki sposób działa to oprogramowanie? Tj. chodzi mi głównie o zarządzanie sesją użytkownika i powiązanymi, np. uprawnieniami dostępu - nie widzę nigdzie odwoływań do $_SESSION, a ja do tej pory kiedy logowałem użytkownika, to ustawiałem sobie wszystkie dane w tablicy $_SESSION. Widzę za to jedną wielką klasę w której są informacje o użytkownikach. O to mi mniej więcej chodzi.


Czego od nas oczekujesz? Że ktoś Ci napisze gotowca? Jak ma Ci to wytłumaczyć? Na temat OOP są masy książek i każdy z nas poświęcił sporo czasu, żeby poznać OOP. A nawet jak już piszesz kod OOP to cały czas się uczysz i za jakiś czas patrząc na kod stwierdzasz, że w sumie da się to lepiej napisać. Więc co mamy CI wytłumaczyć?

Na tym forum nie raz były poruszane tematy. Poczytaj. Możesz zacząć od tego http://pl.wikipedia.org/wiki/Programowanie_obiektowe
  Forum: Object-oriented programming · Podgląd postu: #447183 · Odpowiedzi: 7 · Wyświetleń: 2 456

Jarod
Napisane: 25.02.2008, 17:18:45





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

  1. <?php
  2. $zapytanie1 = "SELECT id,tytul,tresc,autor,data FROM news ORDER BY id DESC";
  3. ?>
  Forum: Przedszkole · Podgląd postu: #446812 · Odpowiedzi: 2 · Wyświetleń: 1 014

Jarod
Napisane: 26.02.2008, 00:06:13





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

  1. <?php
  2. $sSubject = "1ad9-b0- ";
  3. $sPattern = '@^[a-zA-Z0-9-s]+$@';
  4.  
  5. if (preg_match($sPattern, $sSubject)) echo 'Podany ciag jest prawidlowy';
  6. else echo 'Ciag nieprawidlowy !!!';
  7. ?>
  Forum: PHP · Podgląd postu: #446981 · Odpowiedzi: 4 · Wyświetleń: 1 543

Jarod
Napisane: 19.02.2008, 14:44:15





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

A nie mógłbyś odczytać kodu ASCII (enter ma 13- jak dobrze pamiętam)? Przerobiona na szybko funkcja do blokowania klawiszy (nie sprawdzałem). I podczep ją pod zdarzenie onKeyUp
Kod JS:
  1. <?php
  2. var counter = 0;
  3. function sum(evt)
  4. {
  5. var keyCode
  6.  
  7. if (window.event)
  8. {
  9. keyCode = window.event.keyCode;
  10. if (keyCode == 13 && counter < 7) counter++;
  11. if (counter < 7) window.event.returnValue = true;
  12. else window.event.returnValue = false;
  13. }
  14. else
  15. {
  16. keyCode = evt.which;
  17. if (keyCode == 13 && counter < 7) counter++;
  18. if (counter < 7)
  19. {
  20. evt.returnValue = true;
  21. }
  22. else
  23. {
  24. evt.returnValue = false;
  25. evt.preventDefault();
  26. }
  27. }
  28.  
  29. document.forms["test"]["counter"].value = counter;
  30. }
  31. ?>


Kod html
  1. (...)
  2. echo '<form name="test" action="akcja" method="post">';
  3. echo '<p><textarea name="sCompanyName" cols="70" rows="4" id="sCompanyName" onkeypress="sum(event);"></textarea></p>';
  4. echo '<p>Ilość enterów: <input type="text" name="iQuantity[]" value="" id="counter" /></p>';
  5. echo '</form>';
  6. (...)
  Forum: JavaScript · Podgląd postu: #444302 · Odpowiedzi: 21 · Wyświetleń: 3 908

Jarod
Napisane: 14.02.2008, 15:56:17





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

  1. div {
  2. min-height: 800px;
  3. height: auto !important;
  4. height: 800px;
  5. }
  Forum: PHP · Podgląd postu: #442246 · Odpowiedzi: 1 · Wyświetleń: 933

Jarod
Napisane: 14.02.2008, 22:06:10





Grupa: Zarejestrowani
Postów: 1 190
Dołączył: 23.04.2005

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

Podałem Ci przykład. Dostosuj sobie do swoich potrzeb.
  Forum: Po stronie przeglądarki · Podgląd postu: #442409 · Odpowiedzi: 10 · Wyświetleń: 2 059

2 Stron V   1 2 >

New Posts  Nowe odpowiedzi
No New Posts  Brak nowych odpowiedzi
Hot topic  Popularny temat (Nowe)
No new  Popularny temat (Brak nowych)
Poll  Sonda (Nowe)
No new votes  Sonda (Brak nowych)
Closed  Zamknięty temat
Moved  Przeniesiony temat
 

RSS Wersja Lo-Fi Aktualny czas: 29.03.2024 - 16:18