Quick PHP Question. I am kinda newb to PHP so bear with me.
Why this ends up with 500 server error?
<?php
//session start
session_start();
//one time ticket is issued
$ticket = md5(uniqid(mt_rand),TRUE);
//put var ticket in SESSION array which is used in next page.
$_SESSION['ticket'][] = $ticket;
...
$_SESSION['ticketPOST'] = $_POST['ticket'];
...
//functionize htmlspecialchars
function h($string) {
return htmlspecialchars($string, ENT_QUOTES);
}
?>
in same file down below, I wrote something like this:
<form action="brahbrah.php" method="post">
<input type="hidden" name="ticket" value="<?php echo h($ticket); ?>">
<input type="submit" name="indexForm" value="preview">
</form>
any help appreciated. Thanx.