<?php
include("yoursay.class.php");
$x=new XMLcomments("example.xml");
if($_POST['comment'])
{
$x->newComment(nl2br(htmlspecialchars($_POST['comment'])),htmlspecialchars($_POST['author']));
}
?>
<html>
<head>
<title>Comments</title>
</head>
<style type="text/css">
*{margin:0;padding:0;line-height:1.2em;font-size:100%;}
div.comment{
background-color:#999;
padding:3px 5%;
}
div.comment p{
background-color:#EEE;
padding:0 3px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
}
div.comment span{
padding-left:40px;
font-weight:bold;
}
#comform label{
display: block;
float: left;
width: 150px;
padding: 0;
text-align: right;
}
#comform fieldset{
border:1px solid #BBB;
}
#comform{
display:block;
margin: auto;
padding: 0;
min-width: 500px;
max-width: 600px;
width: 560px;
text-align:left;
}
.IEcenter{text-align:center;}
#comform br{clear:left;}
#comform textarea,#comform input{margin:0 0 0 10px;}
</style>
<body>
<?
$x->show();
?>
<div class="IEcenter">
<form id="comform" action="<?=$PHP_SELF?>" method="post">
<fieldset>
<legend>Submit Comment</legend>
<label for="name">Name:</label>
<input type="text" id="name" name="author"><br>
<label for="com">Comment:</label>
<textarea style="width:300px;height:75px" name="comment"></textarea><br>
<div class="IEcenter"><input style="display:block;margin:auto;" type="submit" value="Submit"></div>
</fieldset>
</form>
An Online version of this can be found at <a href="http://www.scripty.co.uk/classes/yoursay/example.php">Scripty.co.uk</a>
</div>
</body>
</html>