And one more thing... I've tried the following in the index_mystart.php as a starting point to build up my mod but it doesn't seem to work. It keeps displaying the same page to me. What puzzles me is that there is an echo $sql; statement, but I don't see anything being echoed! May I know the possible explanation to this along with the answer for my previous post?
[php]<?php
$_user_location = 'users';
define('AT_INCLUDE_PATH', '../../include/');
require (AT_INCLUDE_PATH.'vitals.inc.php');
$_custom_css = $_base_path . 'mods/hello_world/module.css'; // use a custom stylesheet
?>
<!-- <div id="helloworld">
This is a page of the Hello World module that requires a login session, but might contain a tool that is not a course tool :)
</div> -->
<?php
if (isset($_POST['submit'])) {
$sql = "SELECT * FROM ".TABLE_PREFIX."courses";
echo $sql;
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
if($_POST['$row[title]'])
echo "Exists";
/*if ($result = mysql_query($sql,$db)) {
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
}else{
$msg->addError('EC_COURSE_PAYMENT_SETTINGS_NOT_SAVED');
}*/
header('Location: '.$_SERVER['PHP_SELF']);
exit;
}
?>
<?php
require (AT_INCLUDE_PATH.'header.inc.php');
//Get the various courses in the database into this page and then display them in a row with a checkbox
//besides each record. ?>
<div id="custom">
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="POST">
<?php
$sql = "SELECT * FROM ".TABLE_PREFIX."courses";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
echo "<input type='checkbox' name='".$row[title]."' value='".$row[course_id]."'/>"." ".$row[title]."<br>";
?>
<div class="row buttons">
<input type="submit" name="submit" value="<?php echo "Submit"; ?>" />
</div>
</form>
</div>
<?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>[/php]