Академический Документы
Профессиональный Документы
Культура Документы
<?php
$con=mysql_connect("localhost","root","");
if($con){
}else{
$db=mysql_query($sql,$con);
/*if($db){
echo"database created";
}else{
}*/
$db_select=mysql_select_db("student_regisration",$con);
if($db_select){
echo"database selected";
}else{
$tb="create table registration(firstName varchar(20) not null,lastName varchar(20) not null,userName varchar(15) not null,password
varchar(20) primary key,address varchar(50) not null,gender varchar(10) not null,course varchar(5) not null)";
$tb_running=mysql_query($tb,$con);
if($tb_running){
echo"table created";
}else{
?>
REGISTRATION AND INSERTION SCRIPT
<html><head><title>Registration form</title></head><body>
First Name:<br>
Last Name<br>
User Name<br>
Password<br>
Address<br>
</textarea><br>
Gender<br>
Course<br>
<select name="course">
</select><br>
</form>
</body>
</html>
<html><head><title>Login form</title></head>
<body>
<?php
$con=mysql_connect("localhost","root","");
$sql=mysql_select_db("student_regisration",$con);
if($sql){
echo"database selected";
}else{
$insertion=mysql_query($insert,$con);
if($insertion){
echo"data inserted";
}else{
?>
LOGIN FORM PLUS SCRIPT
Password<br>
</form>
</body>
</html>
<?php
$con=mysql_connect("localhost","root","");
$db_select=mysql_select_db("student_regisration",$con);
$username=$_POST['uname'];
$password=$_POST['pass'];
$result=mysql_query($select,$con);
$count=mysql_num_rows($result);
if($count >0){
}else{
?>