You know how on forums and things like that, if you type in the character '>', or ', or ", or ;, or }/],, etc. and you post, normally that would mess things up, but looking at the source of my forum post, it changed my > to an >.
How did they do this? It's pretty cool but I've searched and searched but found nothing, but then again, I'm a bad Googler.
I'm not asking for the entire code, although that would be great, but what is this called? PHP, JavaScript? I don't know.
Also, in a user input form, if they do an enter space, the parser replaces it with a <br />. I can't figure out how to do this...
Here's what AI have, this is 'makeyourreview.php':
Code:
<div id="contentboxtitle">
<h1>Make Your Review</h1>
</div>
<div id="contentbox">
<em>If you want to write your review for PGReviews, use this handy generator to get it all right!</em>
</div>
<form action="process.php" method="post">
<p>TItle Of Review:
<input type="text" name="reviewtitle" /></p>
<p>Author Of Review (Your Name):
<input type="text" name="authorname" /></p>
<p>Review:
<textarea name="reviewcontent" rows="10" cols="87"></textarea>
</p>
<input type="submit" value="Submit" />
</form>
And this is 'process.php':
Code:
<?php
$reviewTitle = $_POST["reviewtitle"];
$reviewAuthor = $_POST["authorname"];
$reviewContent = $_POST["reviewcontent"];
?>
<div id="contentboxtitle">
<h1><?php echo $reviewTitle ?></h1>
</div>
<p><em>A review submitted by <?php echo $reviewAuthor ?></em></p>
<p><?php echo $reviewContent ?></p>
And here's it in action:
http://www.pgreviews.com/makeyourreview.php
I know I have a lot of work to do, but here's a good test to type into that box:
Quote:
Hello, I'm Physicsguy, and I'm just testing: => This generator!
I just put an enter space in, what about a semicolon? ;;; or " ' { } [ ] | \ / > <
Just a bunch of tests ^^
Okay, they work, but I still have trouble with the spacing, like replacing the enter button with an add line break thing. I'd say the (br /) tag, but if I typed it with the sharp brackets, it would actually render as a BR! Also, if you type HTML into this, as well as PHP, it will execute it, making this really insecure.
<?php echo "<h5>Hey there, PHP test!</h5>"; ?>
<h1>HTML TEST!!</h1>
<span style="color: green;">Green test</span>
Great! the change colour one doesn't work! That's good! But if you type in PHP, you get the last "; ?> in it!!
|