I am working on a standalone anonymous question and answer system for work. These damn students never seem to want to ask what they fear might be a stupid question in class, so this will allow them to submit anonymous questions to their course directors.
So far the structure is the following:
comment
comment/index.php
comment/header.php
comment/footer.php
comment/config.php
comment/includes/db.php
comment/includes/mysql.php
comment/includes/function.php
comment/language/lang-english.php
My index.php is where I will have most of my functions such as index(), reply(), comment() ..... etc.
The function.php is where I will do some check_html() stuff.
This is my first standalone application. My problem is my index.php page has the following that doesn't appear to be working at all.
switch($op) {
case "comment":
comment($cid);
break;
case "reply":
reply($cid);
break;
default:
index();
break;
}
index() lists all the comments on the page and there is a reply button at the bottom that would I hope send me to the reply function such as:
OpenTable();
echo "<form method=\"post\" action=\"" .$_SERVER['PHP_SELF'] ."\">\n";
echo '<table width="99%" border="0"><tr><td width="500">';
//formatTimestamp($date);
echo '<p><b>'.$topic.'</b><br />'._BY." $name "._ON." $time";
echo '</p></td></tr><tr><td>'.$comment_text.'</td></tr></table><br /><br />';
echo '<input name=\'submit\' type=\'Submit\' value=\'Reply\'>';
echo '<input name=\'op\' type=\'hidden\' value=\'reply\'>';
echo '<input name=\'op\' type=\'hidden\' value=\'$cid\'>';
echo '</form>';
echo ' <hr>';
CloseTable();
The only thing that is happening is my index.php is refreshing.