Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][HTML] Skrypt rozkleja szablon - dlaczego?
thomson89
post 29.03.2009, 20:07:27
Post #1





Grupa: Zarejestrowani
Postów: 1 178
Pomógł: 51
Dołączył: 7.01.2009
Skąd: Gdańsk

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


Witam!

Dzisiaj zbudowałem sobie tokena. Prosty nie wiem czy skuteczny - dla mnie wystarczy. Ponizej przedstawiam tylko kod tokena, zamknięty w funkcji. Niestety jak dołączam go poprzez require_once używany przeze mnie szablon rozkleja się. Niestety nie wiem dlaczego. Proszę o pomoc.

Wygląd po dołączeniem i wygląd przed dołączeniem.

CODE

<?php
function formularz_ksiegi(){

session_start();

//****************************************//
//*******USTAWIANIE OBRAZKA TOKENA********//
//****************************************//


$_SESSION['token'] = '';

$obrazek[1] = 'A';
$obrazek[2] = 'D';
$obrazek[3] = 'C';
$obrazek[4] = 'O';
$obrazek[5] = 'Y';
$obrazek[6] = 'E';
$obrazek[7] = 'W';
$obrazek[8] = 'b';
$obrazek[9] = 'L';


//-------------------------------------------
//PIERWSZA LICZBA

$control = mt_rand(0,1);
if($control == 0){
$liczba = rand(0,14);
$_SESSION['token'] .= $liczba;
$img= '<img src="design/token/'.$liczba.'.gif" />';

}

if($control == 1){

$liczba = rand(1,9);
$_SESSION['token'] .= $obrazek[$liczba];
$img= '<img src="design/token/'.$obrazek[$liczba].'.gif" />';

}

//-------------------------------------------
//DRUGA LICZBA

$control = mt_rand(0,1);
if($control == 0){

$liczba = rand(0,14);
$_SESSION['token'] .= $liczba;
$img .= '<img src="design/token/'.$liczba.'.gif" />';

}

if($control == 1){

$liczba = rand(1,9);
$_SESSION['token'] .= $obrazek[$liczba];
$img .= '<img src="design/token/'.$obrazek[$liczba].'.gif" />';

}

//-------------------------------------------
//TRZECIA LICZBA

$control = mt_rand(0,1);
if($control == 1){

$liczba = rand(0,14);
$_SESSION['token'] .= $liczba;
$img .= '<img src="design/token/'.$liczba.'.gif" />';

}

if($control == 0){

$liczba = rand(1,9);
$_SESSION['token'] .= $obrazek[$liczba];
$img .= '<img src="design/token/'.$obrazek[$liczba].'.gif" />';

}

//-------------------------------------------
//CZWARTA LICZBA

$control = mt_rand(0,1);
if($control == 0){

$liczba = rand(0,14);
$_SESSION['token'] .= $liczba;
$img .= '<img src="design/token/'.$liczba.'.gif" />';

}

if($control == 1){

$liczba = rand(1,9);
$_SESSION['token'] .= $obrazek[$liczba];
$img .= '<img src="design/token/'.$obrazek[$liczba].'.gif" />';

}

//****************************************//
//*****************KONIEC*****************//
//****************************************//

?>


 <p align="left"><h2>Dodaj wpis do księgi gości</h2></p>
 <br>
 <form action="sprawdz.php" method="post">
 <table align="left">
 
 <tr><td>Twoje imię: </td> <td><input type="text" name="imie"></td></tr>
 
 <tr><td>Numer GG: </td> <td><input type="text" name="gg"></td></tr>
 
 <tr><td>Email: </td> <td><input type="text"name="email"></td></tr>
 
 <tr><td valign="top">Twoje imię:</td> <td><textarea name="tresc" ></textarea></td></tr>
 
 <tr><td>   </td> <td>   </td></tr>
 
 <tr><td>   </td> <td><?php echo $img; ?></td></tr>
 
 <tr><td> Kod weryfikacyjny:    </td> <td><input type="text" name="token"></td></tr>
 
 <tr><td>   </td> <td>   </td></tr>
 
 <tr><td>   </td> <td><input type="submit" value="Wyślij" id="przycisk"></td></tr>
 
 </table>
 
 </form>


<?php

}

?>


Ten post edytował thomson89 29.03.2009, 21:05:14


--------------------
Sklep 70%
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 Wersja Lo-Fi Aktualny czas: 8.07.2025 - 00:51