Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<?php
session_start();
$con=mysqli_connect("localhost","root","","myhmsdb");
if(isset($_POST['adsub'])){
$username=$_POST['username1'];
$password=$_POST['password2'];
$query="select * from admintb where username='$username' and password='$password';";
$result=mysqli_query($con,$query);
if(mysqli_num_rows($result)==1)
{
$_SESSION['username']=$username;
header("Location:admin-panel1.php");
}
else
// header("Location:error2.php");
echo("<script>alert('Invalid Username or Password. Try Again!');
window.location.href = 'index.php';</script>");
}
if(isset($_POST['update_data']))
{
$contact=$_POST['contact'];
$status=$_POST['status'];
$query="update appointmenttb set payment='$status' where contact='$contact';";
$result=mysqli_query($con,$query);
if($result)
header("Location:updated.php");
}
function display_docs()
{
global $con;
$query="select * from doctb";
$result=mysqli_query($con,$query);
while($row=mysqli_fetch_array($result))
{
$name=$row['name'];
# echo'<option value="" disabled selected>Select Doctor</option>';
echo '<option value="'.$name.'">'.$name.'</option>';
}
}
if(isset($_POST['doc_sub']))
{
$name=$_POST['name'];
$query="insert into doctb(name)values('$name')";
$result=mysqli_query($con,$query);
if($result)
header("Location:adddoc.php");
}