PHP, Database and XML/JSON

profileDilru
index.php

<?php ob_start(); session_start(); include 'includes/methods.php'; if(isset($_POST['captcha_code'])){ if(empty($_SESSION['captcha_code'] ) || strcasecmp($_SESSION['captcha_code'], $_POST['captcha_code']) != 0){ $msg="<span style='color:red'>Capthca Verification Failed</span>"; }else{ $username = $_POST['username']; $password = $_POST['password']; $status = authenticateme($username,$password); if($status==False){ $msg="<span style='color:red'>Username password doesn't match</span>"; }else{ //var_dump($status); // print_r($status); create_session($status); oci_free_statement($status); oci_close($con); //echo "<script>alert( 'text:".$_SESSION['type']."')</script>"; header("Location:home.php"); exit; } } } ?> <html> <head> <title>Login</title> <?php include 'includes/header_files.php'; ?> <link href="static/css/captcha_style.css" rel="stylesheet"> <script type='text/javascript'> function refreshCaptcha(){ var img = document.images['captchaimg']; img.src = img.src.substring(0,img.src.lastIndexOf("?"))+"?rand="+Math.random()*1000; } </script> </head> <body> <br/><br/> <div class="container"> <!--Form with header--> <div class="card"> <div class="card-block"> <!--Header--> <div class="form-header purple darken-4"> <h3><i class="fa fa-lock"></i> Login:</h3> </div> <form action="" method="post"> <div class="md-form"> <i class="fa fa-envelope prefix"></i> <input type="text" id="username" name="username" class="form-control" required="required"> <label for="username">Your username</label> </div> <div class="md-form"> <i class="fa fa-lock prefix"></i> <input type="password" id="pass" name="password" class="form-control" required="required"> <label for="pass">Your password</label> </div> <div class="md-form"> <img src="captcha.php?rand=<?php echo rand();?>" id='captchaimg'><br> <input id="captcha_code" id="message" placeholder="Enter capthca code here " name="captcha_code" type="text"> <br> Can't read the image? click <a href='javascript: refreshCaptcha();'>here</a> to refresh. <?php if(isset($msg)){ echo $msg; } ?> </div> <div class="text-center"> <button class="btn btn-deep-purple">Login</button> </div> </form> </div> </div> </div> <?php include 'includes/footer_files.php'; ?> </body> <html>