Comments section within KEL CHM
Hello,
I am trying to create a comments section within my "HELP" document, which I am creating within KEL CHM.
Below is the code:
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<form action="com.txt" method="POST">
<label> Name:
<input type="text" name="Name" class="Input" style="width: 100%" required>
</label>
<br><br>
<label> Comment: <br>
<textarea name="Comment" class="Input" style="width: 100%" required></textarea>
</label>
<br><br>
<input type="submit" name="Submit" value="Submit Comment" class="Submit">
</form>
</body>
</html>
<?php
if($_POST['Submit']){
print "<h1>Your comment has been submitted!</h1>";
$Name = $_POST['Name'];
$Comment = $_POST['Comment'];
#Get old comments
$old = fopen("comments.txt", "r+t");
$old_comments = fread($old, 1024);
#Delete everything, write down new and old comments
$write = fopen("comments.txt", "w+");
$string = "<b>".$Name."</b><br>".$Comment."<br>\n".$old_comments;
fwrite($write, $string);
fclose($write);
fclose($old);
}
#Read comments
$read = fopen("comments.txt", "r+t");
echo "<br><br>Comments<hr>".fread($read, 1024);
fclose
?>
I am trying to create a comments section within my "HELP" document, which I am creating within KEL CHM.
Below is the code:
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<form action="com.txt" method="POST">
<label> Name:
<input type="text" name="Name" class="Input" style="width: 100%" required>
</label>
<br><br>
<label> Comment: <br>
<textarea name="Comment" class="Input" style="width: 100%" required></textarea>
</label>
<br><br>
<input type="submit" name="Submit" value="Submit Comment" class="Submit">
</form>
</body>
</html>
<?php
if($_POST['Submit']){
print "<h1>Your comment has been submitted!</h1>";
$Name = $_POST['Name'];
$Comment = $_POST['Comment'];
#Get old comments
$old = fopen("comments.txt", "r+t");
$old_comments = fread($old, 1024);
#Delete everything, write down new and old comments
$write = fopen("comments.txt", "w+");
$string = "<b>".$Name."</b><br>".$Comment."<br>\n".$old_comments;
fwrite($write, $string);
fclose($write);
fclose($old);
}
#Read comments
$read = fopen("comments.txt", "r+t");
echo "<br><br>Comments<hr>".fread($read, 1024);
fclose
?>
- calumbus53
- Posts: 1
- Joined: Tue Mar 28, 2017 11:52 am
I'm afraid you have found the wrong location for questions about the KEL CHM product. This forum is for the Knowledge Engineering Language for the HPCC big data platform. Nobody here is knowledgeable about help files. Sorry.
- eblood66
- Posts: 2
- Joined: Fri Jan 27, 2012 8:08 pm
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest