Hello Everyone:
I might need your help in the coming months.
I will be helping build a website for a on-line School written in PHP, SQL, HTML, XML and flash
I know some PHP and SQL enough to get into trouble.
What I'm looking for is how to or templates on how to design the following.
Register forum: Client fill in their personal info. once complete sends a comfirmation by email.
My Account info- shows Member ID, Password, couse took/taken currently, test scores....
Test Completion page: interactive test (will be written mostly in XML and Flash) need to some how transfer test results to db. if pass prints out certficate. Show all test results.
Course Catalog; Subject, title of book, movie, download info, sign up for course, who taking what couse. payment (paypal)
Any leads or ideals would be great.
thanks
nomad
for he register form you basicall got to just create a form in html:
ex:
-
<form action="" method="POST">
-
<input name="username" size="15" />
-
<input type="password" name="password" size="8" />
-
<input type="submit" name="login" value="Login" />
-
</form>
-
Like that and the PHP part would be something like:
[PHP]
<?php
if( isset($_POST['login']) ){
// Check if they entered anything in the inputs
if (!$_POST["username"] || !$_POST["password"]) {
die("You need to provide a username and password.");
}
// Create query
$sql0 = "SELECT * FROM `members` "
."WHERE `username`='".$_POST["username"]."' "
."AND `password`='".$_POST["password"]."' "
."LIMIT 1";
// Run query
$sql = mysql_query($sql0);
if ( $create = @mysql_fetch_object($sql) ) {
// Login was successful, create the session variables
$_SESSION["uid"] = $create->id;
$_SESSION["uname"] = $_POST["username"];
$_SESSION["utime"] = time();
// Redirect to member page
header("Location: memberspage.php");
} else{
// Login has failed
die("Login was unsuccessful, Wrong login information.");
}
}
?>
[/PHP]
And for all the member pages you can put this in the header:
[PHP]
if (!$_SESSION["uid"])
{
// User not logged in, redirect to login page
header("Location: login.php");
}
[/PHP]