can someone hep me in making a php based enrollment system? im a beginner in php e... cn u give me some idea in making these?

yeah it would help if you can tell us what you need it to do and maybe what database information you want to store.

ahh okie... a kind for enrolling system for universities.... that is my project... my idea is like this

Login window ---> account profile(display information from the one who logged in., such as the name etc and it will also display the subjects that he had taken) i got problem here also i dont know how to display the information for the logger.. coz im juz a noob wahuhu...--->Encoding page(this is where will i add subjects and there should also a limited number of units..)

this is my idea..

questions
in the encoding page is it possible theres a grid table above that consists of the available subjects to take and below the grid table there's also another table .... my idea is in the table above i'll just click the sjubects and it will appear in the table above... hope u understand heheh...

its not really that hard. to do it though you need a database. i prefer mysql but others will do. once i know you have a database, i can start to help you with the code.

please explain some more... this seems pretty simple but i dont know what your trying to say by "encoding page"?

in encoding page... this is where will i add subjects that cant be taken.... by the way i finish my database now by use of mysql...

this is the table

id username password firstname lastname...etc


i also finished the database for schedules and subjects....

@kkeith29

ms keith i finish in making the database hehhe.. u can help me now,,, hhaha

i have one question. how do your users get their information into the database. do you have to manually put them in or does there need to be a registration page for them as well.

i put them manully... i dont need a registration page... anyway do u have a YM? so i can chat with u if i have a question heheh

since all the databases are done, please post the table names and the fields in each to so i can make the code. i typed up the login page but to use the mysql sever you need to have this page made for me.

SAVE AS mysql.php

<?php
$con = mysql_connect("host","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$database = mysql_select_db('db_name', $con);
if (!$database) {
echo "DATABASE COULDN'T BE SELECTED";
}
?>

Here is the html form

<form action="login.php" method="post">
<p>Username:<input type="text" name="user" /></p>
<p>Password:<input type="password" name="pass" /></p>
<p><input type="submit" name="submit" value="login" /><input type="reset" /></p>
</form>

Here is login.php

<?php
session_start();
if (!isset($_SESSION['user']) || !isset($_SESSION['pass'])) {
function check($fieldname)
{
if(!preg_match("/[^a-zA-Z0-9\.\-\Ä\ä\Ö\ö\Ü\ü\,\ ]+$/s",$fieldname)) {
return TRUE;
}
else {
return FALSE;
}
}
$user = $_REQUEST['user'];
$pass = $_REQUEST['pass'];
if (isset($_POST['submit'])) {
$error_msg = '';
$error = 0;
if ($user == NULL) {
$error_msg .= "Username field is not filled out\\n\\n";
$error++;
}
if (!$user == NULL && !check($user)) {
$error_msg .= "Username field contains illegal characters\\n\\n";
$error++;
}
if ($pass == NULL) {
$error_msg .= "Password field is not filled out\\n\\n";
$error++;
}
if (!$pass == NULL && !check($pass)) {
$error_msg .= "Password field contains illegal characters\\n\\n";
$error++;
}
if ($error > 0) {
$error_msg .= "There currently are " . $error . " errors";
echo '<script type="text/javascript">alert ("' . $error_msg . '");</script>';
}
if ($error == 0) {
include 'mysql.php';
$sql = "SELECT * FROM users WHERE users.username = '" . $user . "'";
$check = mysql_query($sql);
if (mysql_num_rows($check) == 0) {
die('Username doesn\'t exist');
}
while ($q = mysql_fetch_assoc($check)) {
if ($q['password'] !== $pass) {
die('Username or Password is incorrect');
}
$_SESSION['user'] = $user;
$_SESSION['pass'] = $pass;
$_SESSION['fname'] = $q['firstname'];
$_SESSION['lname'] = $q['lastname'];
echo '<meta http-equiv="refresh" content="0;url=member.php" />';
}
mysql_close($con);
}
}
else {
echo 'Please fill out the form first before visting this page';
}
}
else {
echo 'You are already logged in';
}
?>

It goes to a member.php page where the login name and first and last names are shown. other features will be added once you explain in more detail exactly what you want.

by the way i put the username password and the field names in the same field.. is it ok to that?

the table name is student
and the field names that needed to be shown is the last name, first name, middle initial, gender, birthdate,
yearlevel, course and email add thats the infos need to be shown after login...

in next page which is the encoding page ... this is where will i add subjects.. as i say is it possible that all of the available subjects will be display in a table and from there i'll just click what subject i want to enroll and it will be display in the table below?.. thx very much for hel keith! hihi...

ms keith the login.form is now working... we can do now the display information page or the member.php

sorry about this, i know this might be a burden on you but i have a php code to create the student table. you have to delete yours first or the code will fail. i am doing this so there is no confusion of field names and such when i create the code.

here is the code:

<?php
$con = mysql_connect("host","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$database = mysql_select_db('db_name', $con);
if (!$database) {
echo "DATABASE COULDN'T BE SELECTED";
}
$sql = 'CREATE TABLE student(
id INT AUTO_INCREMENT PRIMARY KEY NOT NULL,
username VARCHAR(40) NOT NULL,
password VARCHAR(40) NOT NULL,
lname VARCHAR(40) NOT NULL,
fname VARCHAR(40) NOT NULL,
minitial VARCHAR(5) NOT NULL,
gender VARCHAR(30) NOT NULL,
birthdate VARCHAR(30) NOT NULL,
yearlevel VARCHAR(20) NOT NULL,
course VARCHAR(60) NOT NULL,
email VARCHAR(60) NOT NULL)';
$query = mysql_query($sql);
if (!$query) {
echo 'query unsuccessful';
}
else {
echo 'query ok';
}
mysql_close($con);
?>

just save it as something and run it on your server after filling out the database connect info.

to make the encoding page i will need a list of the courses/subjects you can take. also, where are the course you select going to be stored.

hey everyone, im a newbie here. can someone help me programming php with mysql? i need to figure out my pre-enlistment system online using these languages but im having trouble encoding. even a program of enrollment system could help. just want to have an idea how it works. plsssss.! i need it asap. thanks in advance....

Welcome to daniweb inthan12
If you have problem with your code you better post it and point as to your problematic areas. Unfortunately nobody will do it for you asap. Some more info can be found on
homework announcement.

is there any final project for the php enrollment system. can i have a copy please...

sorry i don't have the code anymore. i created it almost a year ago and i have changed computers 3 times since then.

i am pretty busy. i am creating a few databases right now. post a new thread about this and others will help you.

This article has been dead for over six months. Start a new discussion instead.