Create online registration?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mak15
Forum Newbie
Posts: 5
Joined: Thu Jul 06, 2006 2:28 pm

Create online registration?

Post by mak15 »

Hi! My department had annouced a educational program. I want them to register the program online and created username & password to edit/update their information later (Which will be a secure area for every applicants). Email notification for every submission and edited to the applicant. Is there such scripts out there ? Thanks for any advice!
My server specification:
-WIN2000AdvancedServer
-IIS 5.0
-MySQL
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Post by tecktalkcm0391 »

Create a database and table for users. Have every piece of information as a coulmn have it add the username password ect. then email them (try SwiftMailer (google it)) then have them check there email and then when they open the link a column named accountactive would be set to 1 and then they can login and add there information.
alexus
Forum Contributor
Posts: 159
Joined: Fri Jul 04, 2003 10:49 pm

Post by alexus »

http://www.swish-db.com/tutorials/view.php/tid/601

This is a bit overhelming but describes everithing what u need...

Focus on recording data to MySQL

here is sample code from myself:

Code: Select all

<?
//Register New Profiel

$db_server="server.com";
$db_user="username_of_server";
$db_pass="password";

$db_name="database_name";

$db = mysql_connect($db_server, $db_user, $db_pass);
mysql_select_db($db_name, $db);

//Record data to db
if(isset($submit_registration)){

    $date=date("Y-m-d");

    $sql = "INSERT INTO user SET " .
    "user='$user',".
    "pass='$pass',". 
    "email='$email',".
    "fullname='$fullname',".
    "address='$address',".
    "city='$city',".
    "state='$state',".
    "zip='$zip',".
    "reg_date='$date'";
	if (mysql_query($sql)) {
	    //echo "<center><b>$name added<b></center><br>";
		//echo "Row ID:". mysql_insert_id();
        $reg_status="ok";
        session_register("username");	// register name
		session_register("password"); // register username and password as session variables.
	}else{
		if( mysql_errno() == 1062){
         	//echo "Username $username alredy exist!";
            $reg_status="username_error";
        }else{
        	 $reg_status="error";
        	//echo("<P><b>Error:</b> " .mysql_error() . "</P> Error#:". mysql_errno());	
			//exit();
        }
	}  
}
?>

Note: You gotta have your mysql table structure build first before you use this script. and im too lazy to do a ful tutorial here
mak15
Forum Newbie
Posts: 5
Joined: Thu Jul 06, 2006 2:28 pm

Post by mak15 »

Thank you so much! I will try it myself! :wink:
alexus wrote:http://www.swish-db.com/tutorials/view.php/tid/601

This is a bit overhelming but describes everithing what u need...

Focus on recording data to MySQL

here is sample code from myself:

Code: Select all

<?
//Register New Profiel

$db_server="server.com";
$db_user="username_of_server";
$db_pass="password";

$db_name="database_name";

$db = mysql_connect($db_server, $db_user, $db_pass);
mysql_select_db($db_name, $db);

//Record data to db
if(isset($submit_registration)){

    $date=date("Y-m-d");

    $sql = "INSERT INTO user SET " .
    "user='$user',".
    "pass='$pass',". 
    "email='$email',".
    "fullname='$fullname',".
    "address='$address',".
    "city='$city',".
    "state='$state',".
    "zip='$zip',".
    "reg_date='$date'";
	if (mysql_query($sql)) {
	    //echo "<center><b>$name added<b></center><br>";
		//echo "Row ID:". mysql_insert_id();
        $reg_status="ok";
        session_register("username");	// register name
		session_register("password"); // register username and password as session variables.
	}else{
		if( mysql_errno() == 1062){
         	//echo "Username $username alredy exist!";
            $reg_status="username_error";
        }else{
        	 $reg_status="error";
        	//echo("<P><b>Error:</b> " .mysql_error() . "</P> Error#:". mysql_errno());	
			//exit();
        }
	}  
}
?>

Note: You gotta have your mysql table structure build first before you use this script. and im too lazy to do a ful tutorial here
Post Reply