Jak do poniższego kodu mam dodać prosty token? Poniższy skrypt to formularz do księgi gości
<?php
if($_GET[f] == 'edit' && $_GET[ref] != '' && $book[logged] == true) {
$dane = file($book[katalog
].$book[plik
]); foreach($dane as $linia)
{
$dana = explode($book[separator
], $linia); if($_GET[id]==$dana[0])
<form action="'.$book[katalog].'script.php?q=edit&id='.$_GET[id].'&ref='.$_GET[ref].'" method="post" id="book_form">
<fieldset><legend>Edytuj wpis</legend>
<input type="hidden" name="id" value="'.$dana[0].'" /><input type="hidden" name="data" value="'.$dana[1].'" />
<label for="podpis">Podpis</label><input type="text" id="podpis" name="podpis" value="'.$dana[2].'" /><br />
<label for="mail">E-mail</label><input type="text" id="mail" name="mail" value="'.$dana[3].'" /><br />
<label for="www">WWW</label><input type="text" id="www" name="www" value="'.$dana[4].'" /><br />
<label for="tresc">Treść</label><textarea id="tresc" name="tresc" cols="40" rows="10">'.str_replace('<br />', "\n", $dana[5]).'</textarea><br /> <input type="submit" value="Edytuj wpis" class="submit" />
</fieldset>
</form>';
}
}
else if($_GET[f] == 'delete' && $_GET[ref] != '' && $book[logged] == true) {
<form id="book_form">
<fieldset>
<legend>Usuń wpis</legend>
<span class="warning">Na pewno usunąć dany wpis?!</span><br />
<span class="warning">
<a href="'.$book[katalog].'script.php?q=delete&id='.$_GET[id].'&ref='.$_GET[ref].'">[Tak]</a>
<a href="'.deref($_GET[ref]).'">[Nie]</a>
</span>
</fieldset>
</form>';
}
else if($_GET[f] == 'login' && $_GET[ref] != '') {
<form action="'.$book[katalog].'script.php?q=login&ref='.$_GET[ref].'" method="post" id="book_form">
<fieldset><legend>Logowanie</legend>
<label for="login">Login</label><input type="text" id="login" name="login" /><br />
<label for="haslo">Hasło</label><input type="password" id="haslo" name="haslo" /><br />
<input type="submit" value="Zaloguj" class="submit" /></fieldset></form>';
}
else {
<form action="'.$book[katalog].'script.php?q=add&ref='.ref().'" method="post" id="book_form">
<fieldset><legend>Dodaj wpis</legend>
<label for="podpis">Podpis</label><input type="text" id="podpis" name="podpis" maxlength="100" /><br />';
if($book[dodaj_mail
]==1
)echo' <label for="mail">E-mail</label><input type="text" id="mail" name="mail" maxlength="100" /><br />';
if($book[dodaj_www
]==1
)echo' <label for="www">WWW</label><input type="text" id="www" name="www" maxlength="100" /><br />';
<label for="tresc">Treść (*)</label><textarea id="tresc" name="tresc" cols="40" rows="10"></textarea><br />
<input type="submit" value="Dodaj wpis" class="submit" />
</fieldset>
</form>';
}
?>