forked from prameshbajra/BVC-Student-Portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathin.php
76 lines (57 loc) · 1.46 KB
/
in.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
mysql_connect("localhost","root","") or die ("mysql connection failed");
mysql_select_db("ex") or die ("database selection failed");
ini_set('mysql.connect_timeout',300);
ini_set('default_socket_timeout',300);
if(isset($_POST['sumit']))
{
if(getimagesize($_FILES['image']['tmp_name'])==FALSE)
{
echo"Please select an image.";
}
else
{
$image= addslashes($_FILES['image']['tmp_name']);
$name= addslashes($_FILES['image']['name']);
$image= file_get_contents($image);
$image= base64_encode($image);
saveimage($name,$image);
}
}
function saveimage($name,$image)
{
$con=mysql_connect("localhost","root","");
mysql_select_db("ex",$con);
if($result)
{
echo"</br>Image uploaded.";
}
else
{
echo"</br>Image not uploaded please see wheather the given photo is in .jpg format";
}
}
$nameal = $_POST['nameal'];
$dob = $_POST['dob'];
$branch = $_POST['branch'];
$batch = $_POST['batch'];
$year = $_POST['year'];
$cpo = $_POST['cpo'];
$coww = $_POST['coww'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$aos = $_POST['aos'];
$username = $_POST['username'];
$password = $_POST['password'];
$sql = "insert into `al` values ('$No','$name','$image','$nameal',$dob,'$branch',$batch,$year,'$cpo','$coww','$email',$mobile,'$aos','$username','$password')";
if(mysql_query($sql)){
echo"
<script language='javascript'>;
window.location.href='indoe.php';
</script>
";
}
else{
echo"<h1><center>Please enter all the columns (or) Enter the values correctly</center></h1>";
};
?>