funkcje_tokena.php
<?php function Sesja_tokena() { $token = $_SESSION['randtoken']; } function Generuj_token() { $_SESSION['randtoken'] = $token; } function Zwroc_token() { return $token; } function Resetuj() { $_SESSION['randtoken'] = \"\"; $token = \"\"; } function Zrob_obrazek_tokena() { // header(\"Content-type: image/png\"); $image = @imagecreate(100,20); if($image) { $background = imagecolorallocate($image, 0,0,0); $text = imagecolorallocate($image, 255,255,235); imagestring($image, 4, 25,5, $token, $text); imagepng($image); imagedestroy($image); } } ?>
potem token.php
<?php include('funkcje_tokena.php'); Sesja_tokena($token); Zrob_obrazek_tokena($token); ?>
i strone na ktora ma wyswietlic tokena wys_token.php
<?php include('funkcje_tokena.php'); Generuj_token($token); Zwroc_token(); ?> <html> <head><meta http-equiv="content-type" charset="utf-8" /></head> <body> <form method="post" action="wys_token.php" /> <table> <tr><td width="80"><img src="token.php"></td><td><input type="text" name="token" /></td></tr> </table> </form> </body> </html>
nie wywala zadnego bledy ale zamiast obrazka jest nom wiecie jak sie obrazek nie wysweitli taka chodzby karta i nie wiem co jest zle
