Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
KLUGLUG
Blood Service Portal
Commits
3fb5d898
Commit
3fb5d898
authored
Oct 25, 2019
by
Polavarapu Satya Durga Lalitha Rao Sarma
Browse files
Merge branch 'master' of
https://code.swecha.org/KLUGLUG/blood-service-portal
parents
9d1db319
a2286e70
Changes
1
Hide whitespace changes
Inline
Side-by-side
insert.php
View file @
3fb5d898
<?php
define
(
'DB_SERVER'
,
'localhost'
);
define
(
'DB_USERNAME'
,
'swecha'
);
define
(
'DB_PASSWORD'
,
'swecha'
);
define
(
'DB_DATABASE'
,
'shms'
);
$$nameErr
=
""
;
$con
=
mysqli_connect
(
DB_SERVER
,
DB_USERNAME
,
DB_PASSWORD
,
DB_DATABASE
);
if
(
mysqli_connect_error
())
{
die
(
'Connect Error('
.
mysqli_connect_errno
()
.
')'
.
mysqli_connect_error
());
}
else
{
if
(
isset
(
$_POST
[
'submit'
]))
{
$uname
=
mysqli_real_escape_string
(
$con
,
$_POST
[
'uname'
]);
$email
=
mysqli_real_escape_string
(
$con
,
$_POST
[
'email'
]);
$pass
=
mysqli_real_escape_string
(
$con
,
$_POST
[
'pass'
]);
$rpass
=
mysqli_real_escape_string
(
$con
,
$_POST
[
'rpass'
]);
$query
=
"insert into regiscred (uname,email,pass,rpass) values('
$uname
',
$email
','
$pass
','
$rpass
')"
;
$result
=
mysqli_query
(
$con
,
$query
);
$con
=
mysqli_connect
(
"localhost"
,
"root"
,
""
,
"blood"
);
if
(
$con
===
false
){
die
(
"ERROR: Could not connect. "
.
mysqli_connect_error
());
}
}
$name
=
$_POST
[
'name'
];
$blood
=
$_POST
[
'blood'
];
$age
=
$_POST
[
'age'
];
$city
=
$_POST
[
'city'
];
$mobile
=
$_POST
[
'number'
];
$ld
=
$_POST
[
'ago'
];
$sql
=
"INSERT INTO bloo (uname,blood,age,mobile,city,dd) VALUES ('
$name
', '
$blood
',
$age
,'
$mobile
','
$city
',
$ld
)"
;
$result
=
mysqli_query
(
$con
,
$sql
);
if
(
$result
==
true
){
<
script
>
alert
(
"thanks foro registering"
);
</
script
>
if
(
$result
==
true
)
{
echo
"<h1>Thank You for Being a Blood Donor..You will Receive a Message when there is a Requirement!! </h1>"
;
}
?>
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment