Advertisement
Guest User

Untitled

a guest
Jan 10th, 2018
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.98 KB | None | 0 0
  1. <?php
  2.    
  3.     $candidateID = $_GET['id'];
  4.  
  5.     $dbhost = "localhost";
  6.     $dbname = "linguedo_candidates";
  7.     $dbuser = "linguedo_agathar";
  8.     $dbpass = "Lh+S#b!6[5J#";
  9.     $conn = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname);
  10.                
  11.     if(! $conn ) {
  12.         die('Could not connect to database because: ' . mysqli_error());
  13.     }
  14.  
  15.     $sql = "SELECT * FROM candidates WHERE id=$candidateID";
  16.     $result = mysqli_query($conn, $sql);
  17.  
  18.  
  19.     if (mysqli_num_rows($result) > 0) {
  20.  
  21.         $name = $row["name"];
  22.        
  23.         echo $name;
  24.  
  25.     } else {
  26.         echo "Candidate could not be found in the database :(";
  27.     }
  28.  
  29.     mysqli_close($conn);
  30.  
  31. ?>
  32. <html>
  33.     <head>
  34.         <meta charset="utf-8">
  35.         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  36.         <meta name="description" content="">
  37.         <meta name="author" content="Davide Lionetti">
  38.         <title>John Doe | Agatharied candidates</title>
  39.         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css">
  40.         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  41.         <style type="text/css">
  42.             h1.title {
  43.                 margin: 50px 0;
  44.             }
  45.         </style>
  46.     </head>
  47.     <body>
  48.         <div class="container">
  49.             <div class="col-10 mx-auto">
  50.                 <h1 class="title">Details of the candidate</h1>
  51.                 <div class="jumbotron">
  52.                     <h1 class="display-4"><?= $row["name"]; ?></h1>
  53.                     <p class="lead">john@doe.com</p>
  54.                     <hr class="my-4">
  55.                     <p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
  56.                     <a href="http://www.google.com/" target="_blank" class="btn btn-primary">View CV</a>
  57.                 </div>
  58.                 <div class="alert alert-success" role="alert">
  59.                     This candidate has successfully been added into Bullhorn database.
  60.                 </div>
  61.                 <div class="alert alert-danger" role="alert">
  62.                     <h4 class="alert-heading">Candidate missing in Bullhorn!</h4>
  63.                     <p>Hmmm... it looks like this candidate has not been inserted yet into the Bullhorn database...</p>
  64.                     <hr>
  65.                     <p class="mb-0">But don't panic, I'm here to help you! Just click here below and I'll try to add this candidate into Bullhorn!</p>
  66.                     <a href="http://www.google.com/" class="btn btn-primary mt-2">Add to Bullhorn</a>
  67.                 </div>
  68.             </div>
  69.         </div>
  70.         <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  71.         <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js"></script>
  72.     </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement