session_start();
require_once('Connections/conn.php');
/*include("conn.php");*/
/**
* Returns true if the username has been taken
* by another user, false otherwise.
*/
function usernameTaken($username){
global $conn, $database_conn;
if(!get_magic_quotes_gpc()){
$username = addslashes($username);
}
$q = "select username from users where username = '$username'";
mysql_select_db($database_conn, $conn);
$result = mysql_query($q,$conn);
return (mysql_num_rows($result) > 0);
}
/**
* Inserts the given (username, password) pair
* into the database. Returns true on success,
* false otherwise.
*/
function addNewUser($event, $name, $designation, $org, $email, $phone){
global $conn, $database_conn;
mysql_select_db($database_conn, $conn);
$q = "INSERT INTO postevent VALUES ('$event', '$name', '$designation', '$org' , '$email', '$phone')";
return mysql_query($q,$conn);
}
/**
* Displays the appropriate message to the user
* after the registration attempt. It displays a
* success or failure status depending on a
* session variable set during registration.
*/
function displayStatus(){
$uname = $_SESSION['reguname'];
if($_SESSION['regresult']){
?>
Past Events
Thank you for logging in, click on the links to download
Event
Material Available
E0706: Maple 11 Day
29th September 2007, NCU Taiwan
Presentation Slides (.MW) 11.2MB
*MW extension are Maple Worksheet files, do contact us for a demo copy of Maple to view the presentations
E0705: Comsol User Conference 2007
15th November 2007, NUS
Comsol Users Presentation Slides (.PDF) 6.22MB
E0704: Biosignal Processing, Analysis and Imaging
13th July 2007 , Biopolis
Presentation Slides (.PDF) 220KB
E0701: Simplifying Complexity for Mathematics and Engineering
11th May 2007, Civil Service College
Presentation Slides (.PDF) 5.85MB
E0608: Biosignal Processing and Analysis for Brain Signals
27th October 2006, Biopolis
Presentation Slides (.PDF) 1.44 MB
E0604: High Speed Simulation of Power Electric Circuits
30th May 2006, NTU
Presentation Slides (.PDF) 5.43 MB
E0603/E0606: Using emerging technologies in LMS innovation
We're sorry, but an error has occurred and your registration for the username echo $uname; ?>, could not be completed.
Please try again at a later time.
}
unset($_SESSION['reguname']);
unset($_SESSION['registered']);
unset($_SESSION['regresult']);
}
if(isset($_SESSION['registered'])){
/**
* This is the page that will be displayed after the
* registration has been attempted.
*/
?>
Past Events
displayStatus(); ?>
return;
}
/**
* Determines whether or not to show to sign-up form
* based on whether the form has been submitted, if it
* has, check the database for consistency and create
* the new account.
*/
if(isset($_POST['subjoin'])){
/* Make sure all fields were entered */
if(!$_POST['phone'] || !$_POST['designation'] || !$_POST['event'] || !$_POST['name'] || !$_POST['email']){
die('All are mandatory - please press the back button and try again');
}
/* Spruce up username, check length */
$_POST['user'] = trim($_POST['user']);
if(strlen($_POST['user']) > 30){
die("Sorry, the username is longer than 30 characters, please shorten it.");
}
/* Check if username is already in use */
if(usernameTaken($_POST['user'])){
$use = $_POST['user'];
die("Sorry, the username: $use is already taken, please pick another one.");
}
/* Add the new account to the database */
$event=$_POST['event'];
$name=$_POST['name'];
$designation=$_POST['designation'];
$org=$_POST['org'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$_SESSION['regresult'] = addNewUser($event, $name, $designation, $org, $email, $phone);
$sess=$_SESSION['regresult'];
/* die("Username: $use and Hash Password: $md5pass and Session: $sess"); */
$_SESSION['registered'] = true;
echo "";
return;
}
else{
/**
* This is the page with the sign-up form, the names
* of the input fields are important and should not
* be changed.
*/
?>
Past Events