Created
May 30, 2015 14:44
-
-
Save ghedipunk/be70a61671a50f158016 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* templates/comment-form.php | |
* | |
* NOTE: THIS IS PART OF AN EXAMPLE OF VERY INSECURE CODE! DO NOT USE THIS! | |
*/ | |
?> | |
<?php if ($user->isLoggedIn()) | |
{ | |
?> | |
<form action="/submit.php"> | |
<?php displayValidationMessages($_SESSION['formstate']['comment-form']['messages']); ?> | |
<input type="hidden" name="formid" value="comment-form" /> | |
<input type="hidden" name="csrf-token" value="<?php generateCsrfToken($user); ?>" /> | |
<input type="hidden" name="current-article" value="<?php echo getCurrentArticle(); ?>" /> | |
<textarea rows="4" columns="30" name="comment"> | |
<?php | |
if(!empty($_SESSION['formstate']['comment-form']['comment'])) | |
{ | |
echo $_SESSION['formstate']['comment-form']['comment']; | |
} | |
?> | |
</textarea> | |
<?php | |
} // end if ($user->isLoggedIn()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment