Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]token, token nie chce sie wyswietlic
marcio
post
Post #1





Grupa: Zarejestrowani
Postów: 2 291
Pomógł: 156
Dołączył: 23.09.2007
Skąd: ITALY-MILAN

Ostrzeżenie: (10%)
X----


czesc mam problem probowalem przerobc kod tokena ktory jest napisany na klasach i chodzi na funckje wiec mam 3 pliki
funkcje_tokena.php
  1. <?php
  2.  
  3.  function Sesja_tokena() { 
  4.  
  5. $token = $_SESSION['randtoken']; 
  6.  
  7.  } 
  8.  
  9.  function Generuj_token() {
  10.  
  11.  
  12.  $RandNumber = rand(1,1000);  $token = substr(md5($RandNumber), 0,6); 
  13.  $_SESSION['randtoken'] = $token; 
  14. }
  15.  
  16.  function Zwroc_token() {
  17.  
  18.  return $token;
  19.  
  20.  }
  21.  
  22.  function Resetuj() { 
  23.  
  24.  $_SESSION['randtoken'] = &#092;"\"; 
  25. $token = &#092;"\"; 
  26.  
  27.  }
  28.  
  29.  
  30.  function Zrob_obrazek_tokena() { 
  31.  
  32.  
  33.  // header(\"Content-type: image/png\"); 
  34.  $image = @imagecreate(100,20); 
  35. if($image) { 
  36.  
  37.  $background = imagecolorallocate($image, 0,0,0); 
  38.  $text = imagecolorallocate($image, 255,255,235); 
  39.  imagestring($image, 4, 25,5, $token, $text); 
  40.  header(&#092;"Content-type: image/png\"); 
  41.  imagepng($image); 
  42.  imagedestroy($image);
  43.  } 
  44.  
  45.  }
  46.  
  47.  
  48.  
  49.  
  50.  ?>


potem token.php

  1. <?php
  2. include('funkcje_tokena.php');
  3.  
  4. Sesja_tokena($token);
  5. Zrob_obrazek_tokena($token);
  6. ?>


i strone na ktora ma wyswietlic tokena wys_token.php

  1. <?php
  2. include('funkcje_tokena.php');
  3.  
  4. Generuj_token($token);
  5. Zwroc_token();
  6. ?>
  7.  
  8. <html>
  9. <head><meta http-equiv="content-type" charset="utf-8" /></head>
  10. <body>
  11. <form method="post" action="wys_token.php" />
  12. <table>
  13. <tr><td width="80"><img src="token.php"></td><td><input type="text" name="token" /></td></tr>
  14. </table>
  15. </form>
  16. </body>
  17. </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 sad.gif

Ten post edytował marcio 1.10.2007, 16:18:58


--------------------
Zainteresowania: XML | PHP | MY(SQL)| C# for .NET | PYTHON
http://code.google.com/p/form-builider/
Moj blog
Go to the top of the page
+Quote Post
Daimos
post
Post #2





Grupa: Zarejestrowani
Postów: 1 319
Pomógł: 118
Dołączył: 26.11.2003
Skąd: Lublin

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


wlaczona biblioteka GD?


--------------------
scriptun.com. Startup z poradnikami do gier ttp.zone i ttpzone.pl
Go to the top of the page
+Quote Post
marcio
post
Post #3





Grupa: Zarejestrowani
Postów: 2 291
Pomógł: 156
Dołączył: 23.09.2007
Skąd: ITALY-MILAN

Ostrzeżenie: (10%)
X----


omg ze mnie jest totalny debil zapomnialem..Jak mozna robic obrazki bez biblioteki smile.gif a tak w ogole ktos moze powiedziec jak sie instaluje GD w ubuntu??bo czytam ale nie rozumiem

nie wiem jak sie ja uzywa ale ja zainstalowalem i dalej nie dziala sad.gif


--------------------
Zainteresowania: XML | PHP | MY(SQL)| C# for .NET | PYTHON
http://code.google.com/p/form-builider/
Moj blog
Go to the top of the page
+Quote Post
marcio
post
Post #4





Grupa: Zarejestrowani
Postów: 2 291
Pomógł: 156
Dołączył: 23.09.2007
Skąd: ITALY-MILAN

Ostrzeżenie: (10%)
X----


OK mysle ze teraz jest dobrze jesli nie to prosze powiedziec co poprawic ale czy ktos potrafi pomoc??Moze ktos moze to przetestowac??Na moim servie nie dziala

oki kod dziala jutro napisze co bylo zle biggrin.gif


--------------------
Zainteresowania: XML | PHP | MY(SQL)| C# for .NET | PYTHON
http://code.google.com/p/form-builider/
Moj blog
Go to the top of the page
+Quote Post

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 Aktualny czas: 21.08.2025 - 15:46