Stránka: 1 z 2
| [ Príspevkov: 31 ] | 1, 2 |
| Autor | Správa |
|---|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 | 40 Bydlisko: BA |
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 | 40 Bydlisko: BA |
bo neviem nic najust.... 
|
|
Registrovaný: 03.04.08 Prihlásený: 10.12.19 Príspevky: 4667 Témy: 37 | 37 Bydlisko: Trnava |
_________________ Hmmm .... Hrošíček ... [Homer] |
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 | 40 Bydlisko: BA |
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: 365 Témy: 47 | 47 Bydlisko: TT |
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 | 40 Bydlisko: BA | |
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 | 35 Bydlisko: BA - WESTSIDE |
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 | 40 Bydlisko: BA |
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 | 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 | 35 Bydlisko: BA - WESTSIDE |
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 | 40 Bydlisko: BA |
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 | 35 Bydlisko: BA - WESTSIDE |
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 | 40 Bydlisko: BA |
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 | 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: 365 Témy: 47 | 47 Bydlisko: TT |
... 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 | 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 | 40 Bydlisko: BA |
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: 365 Témy: 47 | 47 Bydlisko: TT |
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 | 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 | 40 Bydlisko: BA |
skusil som tam hodit iny kod a uz mi to ide 
|
|
Registrovaný: 10.07.08 Príspevky: 190 Témy: 40 | 40 Bydlisko: BA |
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 | 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 | 144 Bydlisko: Žilina |
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 | 35 Bydlisko: BA - WESTSIDE |
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 | 144 Bydlisko: Žilina |
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: 13557 Témy: 1483 | 1483 Bydlisko: Bratislava |
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 | Ergotron LX Wall Mount Keyboard Arm | Logitech Craft | Logitech G603 | Logitech F710 | Harman Kardon Sabre SB 35 & Sennheiser RS 175 | Microsoft Windows 11 Enterprise | APC Back-UPS BE-850 VA | Lenovo ThinkPad X1 Carbon | 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 & Samsung SSD 860 1 TB | Ubuntu 24.04 LTS | Dell Wyse 3040 | Intel Atom x5-Z8350 | 2 GB DDR3 1600 MHz | 16 GB eMMC | 24" EIZO FlexScan EV2451 | Alpine Linux + XFCE4 |
|
Registrovaný: 16.01.08 Prihlásený: 27.03.13 Príspevky: 641 Témy: 144 | 144 Bydlisko: Žilina |
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 | 35 Bydlisko: BA - WESTSIDE |
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 | 144 Bydlisko: Žilina |
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 | 96 |
máš na server nakopírovaný font?
|
|
Stránka: 1 z 2
| [ Príspevkov: 31 ] | 1, 2 |
|