| | |
Autor | Správa |
---|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal m4r14n: 19.07.2008 12:17 | |
|
Mohol by mi niekdo napisat link na neaku stranku kde je script na vytvorenie Captchy?
|
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal autor témy m4r14n: 19.07.2008 13:11 | |
|
bo neviem nic najust....
|
|
Registrovaný: 03.04.08 Prihlásený: 10.12.19 Príspevky: 4667 Témy: 37 Bydlisko: Trnava |
_________________ Hmmm .... Hrošíček ... [Homer] |
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal autor témy m4r14n: 19.07.2008 14:52 | |
|
OMG.... nechapem preco mi stale nejde spravit ta captcha.... nasiel som 2 scripty no ani jeden mi nechce ukazovat ten obrazok... myslim ze je problem v php.ini, lebo jeden zo scriptov mi pise toto
Citácia: GD extension is not Loaded! Please load GD extension in your php.ini file.
ale nwm co tam mam zmenit, nic take ako GD som tam nenasiel....
|
|
Registrovaný: 01.01.06 Prihlásený: 25.12.21 Príspevky: 366 Témy: 47 Bydlisko: TT | Napísal jaji: 19.07.2008 18:35 | |
|
aku mas verziu php?
_________________ He who laughs last has not yet heard the bad news.
-- Bertolt Brecht
medicine student |
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal autor témy m4r14n: 19.07.2008 18:55 | |
|
verzia?... no 5.0.0
|
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 Bydlisko: BA - WESTSIDE | Napísal p360t: 19.07.2008 19:11 | |
|
Ide o to, že potrebuješ grafickú knižnicu (GD, alebo GD2) na to aby tvoje PHP skripty mohli generovať obrázky (samotná verzia PHP pri tom nie je rozhodujúca). Sprav si súbor info.php, napíš doňho Kód: <?php phpinfo(); ?> a spusti to na svojom servri. Ak v tom výpise nikde neuvidíš medzi Extensions knižnicu GD/GD2 (čo je podľa tej hlášky v podstate isté), musíš požiadať administrátora servera o jej doplnenie. Väčšina hostingov by ti to mala spraviť na požiadanie. Potom by ti to už fungovať malo.
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal autor témy m4r14n: 19.07.2008 20:27 | |
|
aha.... nooo stranku zatial robim na localhoste, (tam nic o GD nebolo....) ale ked som to skusil dat na freehost IC, tiez mi to nechcelo nacitat Captcha, a v phpinfo(); neake zmienky o GD boli (moc nwm po anglicky..). Myslis ze aj na freehoste IC mi to doplnia?
|
|
Registrovaný: 09.09.07 Prihlásený: 07.11.16 Príspevky: 3114 Témy: 233 Bydlisko: Nové Zámky |
v phpinfo o GD moc nezistis... napis sem, co ti hodi toto:
print_r( gd_info() );
_________________ "It took a lot of work, but this latest Linux patch enables support for machines with 4096 CPUs, up from the old limit of 1024." "Do you have support for smooth full-screen flash video yet?" "No, but who uses that?"
- ak dlho neodpisujem do témy, zabudol som na ňu, takže ma upozornite SS, ak chcete moju odpoveď |
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 Bydlisko: BA - WESTSIDE | Napísal p360t: 19.07.2008 22:44 | |
|
Ok, tak si nájdi v konfiguračnom súbore PHP php.inisekciu Dynamic extensions a v nej odkomentuj (komentár sa začína bodkočiarkou) alebo dopíš riadok Kód: extension=php_gd2.dll (ak používaš Windows), alebo Kód: extension=php_gd2.so (ak používaš Unix).
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal autor témy m4r14n: 19.07.2008 23:30 | |
|
Nasiel som ho a odkomentoval... ale stale nic nezobrazuje... tak ochrany budem asi inak riesit..... Inak diki za rady
|
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 Bydlisko: BA - WESTSIDE | Napísal p360t: 20.07.2008 1:19 | |
|
Skontroluj si ten skript, ktorý ti písal Citácia: GD extension is not Loaded! Please load GD extension in your php.ini file.
Ak ti to už nepíše, je dobre. Chyba je možno ešte inde. Inštalácia takýchto vecí nie je ako inštalácia ICQ (nestačí klikať len na "next"). A možno by nebolo odveci dať sem ten skript (prípadne aj tvoj, do ktorého si tento zakomponoval).
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal autor témy m4r14n: 20.07.2008 1:37 | |
|
Prave ze mi to pise stale .... nwm, instaloval som PHP Home Edition 2 (PHP + apache + mysql) ale pri instalacii som zadal len nazov servra meno + heslo mysql a take (myslim ze nic s tymto spolocne).... a mimo to, ked som to skusal na IC tiez mi to neslo, a myslim ze tam sa do php.ini nedostanem
|
|
Registrovaný: 29.10.07 Prihlásený: 27.10.23 Príspevky: 1395 Témy: 30 Bydlisko: Bratislava |
_________________ PC: OS: Windows 11 (64bit) CPU: AMD Ryzen 5 3600 GPU: ASUS TUF RTX3060Ti 8GB RAM: 16GB DDR4-3200MHz Kingston Fury MB: ASUS TUF Gaming B550M WIFI SSD: 1000GB PCIe M.2 NVME Mobil: Xiaomi POCO F2 PRO |
|
Registrovaný: 01.01.06 Prihlásený: 25.12.21 Príspevky: 366 Témy: 47 Bydlisko: TT | Napísal jaji: 20.07.2008 13:30 | |
|
... ked chces, skus XAMPP, ten ma uz vsetko nainstalovane aj GD.
_________________ He who laughs last has not yet heard the bad news.
-- Bertolt Brecht
medicine student |
|
Registrovaný: 21.02.07 Prihlásený: 21.02.10 Príspevky: 3984 Témy: 96 |
je to taj tu na fóre napísané ale musíš pohľadať ... téma teda existuje a aj tu je script ...
|
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal autor témy m4r14n: 20.07.2008 18:11 | |
|
Ano... vsimol som si ze sa tu uz captcha viackrat spominala... len stale nwm ako by som to dal na IC, ked to nejde...
|
|
Registrovaný: 01.01.06 Prihlásený: 25.12.21 Príspevky: 366 Témy: 47 Bydlisko: TT | Napísal jaji: 20.07.2008 21:45 | |
|
nejde ti to ani na ic.cz? Tam urcite gd je nainstalovane. Mas potom chybu v kode...
_________________ He who laughs last has not yet heard the bad news.
-- Bertolt Brecht
medicine student |
|
Registrovaný: 21.02.07 Prihlásený: 21.02.10 Príspevky: 3984 Témy: 96 |
určite teda vytroríš napr. captcha.php kde bude kód tu z fóra a potom dáš napr v index.php <img src="captcha.php">
|
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal autor témy m4r14n: 21.07.2008 9:58 | |
|
skusil som tam hodit iny kod a uz mi to ide
|
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 Bydlisko: BA | Napísal autor témy m4r14n: 22.07.2008 22:27 | |
|
Som si to PHP Home Edition 2 musel odinstalovat, bo som tam neake veci pokazil v php.ini ...... no a mohli by ste mi poradit, co by som si mal nainstalovat, tak aby som tam mal aj GD kniznicu? A je dobre XAMPP ako hovoril jaji? By ste mi mohli napisat ake s tym mate skusenosti.....
|
|
Registrovaný: 27.07.07 Príspevky: 3948 Témy: 51 Bydlisko: Bratislava |
premazane
staci trosku pohladat a najdes odpoved na svoju otazku, pripadne zaloz novu temu o kladoch/zaporoch jednotlivych balikov
_________________ NTB: Acer Aspire 4820TG 14" | CPU: Intel Core i5 2,53 GHz | VGA: ATI Mobility Radeon HD5650 1GB | RAM: 8GB DDR3 1066 MHz | HDD: 1TB SSD WD BLUE |
|
Registrovaný: 16.01.08 Prihlásený: 27.03.13 Príspevky: 641 Témy: 144 Bydlisko: Žilina | Napísal max-m: 26.09.2008 18:11 | |
|
caute,
neviete mi poradit?
mam subor CaptchaSecurityImages.php:
Kód: <?php session_start();
class CaptchaSecurityImages {
var $font = 'monofont.ttf';
function generateCode($characters) { /* list all possible characters, similar looking characters and vowels have been removed */ $possible = '23456789bcdfghjkmnpqrstvwxyz'; $code = ''; $i = 0; while ($i < $characters) { $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1); $i++; } return $code; }
function CaptchaSecurityImages($width='120',$height='40',$characters='6') { $code = $this->generateCode($characters); /* font size will be 75% of the image height */ $font_size = $height * 0.75; $image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream'); /* set the colours */ $background_color = imagecolorallocate($image, 255, 255, 255); $text_color = imagecolorallocate($image, 20, 40, 100); $noise_color = imagecolorallocate($image, 100, 120, 180); /* generate random dots in background */ for( $i=0; $i<($width*$height)/3; $i++ ) { imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color); } /* generate random lines in background */ for( $i=0; $i<($width*$height)/150; $i++ ) { imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), $noise_color); } /* create textbox and add text */ $textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('Error in imagettfbbox function'); $x = ($width - $textbox[4])/2; $y = ($height - $textbox[5])/2; imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code) or die('Error in imagettftext function'); /* output captcha image to browser */ header('Content-Type: image/jpeg'); imagejpeg($image); imagedestroy($image); $_SESSION['security_code'] = $code; }
}
$width = isset($_GET['width']) ? $_GET['width'] : '120'; $height = isset($_GET['height']) ? $_GET['height'] : '40'; $characters = isset($_GET['characters']) && $_GET['characters'] > 1 ? $_GET['characters'] : '6';
$captcha = new CaptchaSecurityImages($width,$height,$characters);
?> a form.php: Kód: <?php session_start();
if( isset($_POST['submit'])) { if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. echo 'Thank you. Your message said "'.$_POST['message'].'"'; unset($_SESSION['security_code']); } else { // Insert your code for showing an error message here echo 'Sorry, you have provided an invalid security code'; } } else { ?>
<form action="form.php" method="post"> <label for="name">Name: </label><input type="text" name="name" id="name" /><br /> <label for="email">Email: </label><input type="text" name="email" id="email" /><br /> <label for="message">Message: </label><textarea rows="5" cols="30" name="message" id="message"></textarea><br /> <img src="CaptchaSecurityImages.php?width=100&height=40&characters=5" /><br /> <label for="security_code">Security Code: </label><input id="security_code" name="security_code" type="text" /><br /> <input type="submit" name="submit" value="Submit" /> </form>
<?php } ?>
na localhoste mi to ide v pohode, no ked to dam na server (nejedna sa o free ale o plateny), obrazok sa nezobrazi (nevypise ziadnu chybu).
p.s.: mam tam vlozeny aj ten font.
kde moze byt problem?
DIK.
_________________ Mac Book Pro 15.4", CPU: Intel Core 2 Duo 2.8 GHz, RAM: 4GB DDR3, HDD: 500 GB, VGA: 512MB GDDR3, OS: Mac OS X Lion; Mobil: HTC ONE S |
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 Bydlisko: BA - WESTSIDE | Napísal p360t: 26.09.2008 20:11 | |
|
Problém môže byť všelikde, pre začiatok si skontroluj, či ti http://www.tvojastranka/nejaka/cesta/Ca ... aracters=5 naozaj vytvorí ten obrázok.
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 16.01.08 Prihlásený: 27.03.13 Príspevky: 641 Témy: 144 Bydlisko: Žilina | Napísal max-m: 26.09.2008 23:36 | |
|
nie. obrazok sa nevytvori. hodi chybu:
Citácia: Warning: imagettfbbox() [function.imagettfbbox]: Could not find/open font in /domains1/ws048800/public/www_root/CaptchaSecurityImages.php on line 60 Error in imagettfbbox function
_________________ Mac Book Pro 15.4", CPU: Intel Core 2 Duo 2.8 GHz, RAM: 4GB DDR3, HDD: 500 GB, VGA: 512MB GDDR3, OS: Mac OS X Lion; Mobil: HTC ONE S |
|
Registrovaný: 01.05.05 Príspevky: 13349 Témy: 1496 Bydlisko: Bratislava | Napísal JanoF: 26.09.2008 23:41 | |
|
Toto hodilo aj mne ak som tam nemal ttf, mozno blba otazka, nema ten font koncovku TTF velkym? Ak ano tak to premenuj vsetko na male...
_________________ Streacom DA2 | SilverStone Titanium SX800-LTI 800W | ASRock X299E-ITX/ac | Intel Core i9-9980XE & be quiet! Dark Rock TF | Kingston HyperX Impact 64 GB DDR4 2666 MHz | NVIDIA Titan RTX 24 GB | Intel SSD Optane 905P 480 GB NVMe U.2 & Intel SSD 750 1,2 TB NVMe U.2 & Intel SSD 660p 2 TB NVMe M.2 & Seagate BackUp Plus Portable 56 TB USB | 55" 4K OLED Dell Alienware AW5520QF & 24" LCD EIZO FlexScan EV2451 | Ergotron LX Wall Mount Keyboard Arm | Logitech Craft | Logitech G603 | Logitech F710 | Harman Kardon Sabre SB 35 & Sennheiser RS 175 | Microsoft Windows 7 Ultimate | APC Back-UPS ES 700 | Lenovo ThinkPad X250 | iPhone X 256 GB & Pitaka Aramid | SilverStone ML05B Milo | Corsair SF600 SFX 600W | ASRock X99E-ITX/ac | Intel Xeon E5-2683 v4 & NOCTUA NH-L12S | Kingston HyperX Savage 32 GB DDR4 2400 MHz | NVIDIA GeForce GT 710 1 GB | Intel SSD Optane Memory 32 GB NVMe M.2 & Intel SSD 730 240 GB SATA | Ubuntu Server |
|
Registrovaný: 16.01.08 Prihlásený: 27.03.13 Príspevky: 641 Témy: 144 Bydlisko: Žilina | Napísal max-m: 26.09.2008 23:55 | |
|
mam vsetky pripony male a aj nazvy suborov.
_________________ Mac Book Pro 15.4", CPU: Intel Core 2 Duo 2.8 GHz, RAM: 4GB DDR3, HDD: 500 GB, VGA: 512MB GDDR3, OS: Mac OS X Lion; Mobil: HTC ONE S |
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 Bydlisko: BA - WESTSIDE | Napísal p360t: 27.09.2008 11:28 | |
|
Spusti toto na servri a potom na localhoste a napíš sem, čo ti to vypíše:
Kód: <?php var_dump(gd_info()); ?>
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 16.01.08 Prihlásený: 27.03.13 Príspevky: 641 Témy: 144 Bydlisko: Žilina | Napísal max-m: 28.09.2008 0:32 | |
|
na localhoste:
Citácia: array(12) { ["GD Version"]=> string(27) "bundled (2.0.34 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(true) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(false) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) } na serveri: Citácia: array(12) { ["GD Version"]=> string(13) "2.0 or higher" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(false) ["XBM Support"]=> bool(false) ["JIS-mapped Japanese Font Support"]=> bool(false) }
_________________ Mac Book Pro 15.4", CPU: Intel Core 2 Duo 2.8 GHz, RAM: 4GB DDR3, HDD: 500 GB, VGA: 512MB GDDR3, OS: Mac OS X Lion; Mobil: HTC ONE S |
|
Registrovaný: 21.02.07 Prihlásený: 21.02.10 Príspevky: 3984 Témy: 96 |
máš na server nakopírovaný font?
|
|
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|