-
Notifications
You must be signed in to change notification settings - Fork 18
/
insert_data.php
46 lines (37 loc) · 1.04 KB
/
insert_data.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
session_start();
if($_SESSION['authuser']!=1)
{
echo"ACCESS DENIED";
exit();
}
$connect = mysql_connect("localhost", "root", "") or die ("check your server connection.");
mysql_select_db("2008b4a5723p");
$name = $_POST['name'];
$pass = $_POST['pass'];
$branch = $_POST['branch'];
$year = $_POST['year'];
if($name=='' or $pass=='' or $branch=='' or $year=="1")
echo"ERROR IN REGISTRATION";
else{
$insert = "INSERT INTO members(username,password,branch,year)
values('$name','$pass','$branch','$year')";
$results=mysql_query($insert) or die(mysql_error());
echo " Successfully added information";
}
?>
<form method="post" action="welcome(main page).php">
<input type="submit" class="myButton" name="wel" value="click here to go to login page">
</form>
<footer>
<a href="default.aspx" style="color: white;">Back to home</a>
© 2013 Gaikwad Company, Inc. Course Registration System
</footer>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="div1"></div>
</body>
</html>