Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $a = $_POST['findSchool'];
- //1. Enter database credentials
- $servername = "****";
- $username = "****";
- $password = "****";
- $dbname = "****";
- $flag = 0;
- // 2. Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- echo '<form id="myNewForm" name="myNewForm" class="form" method="post" action="">';
- echo '<table class="table table-bordered">';
- echo '<tr scope="col" >
- <th align="center">SchoolName</th>
- <th align="center">Details</th>
- </tr>';
- $sql = "SELECT schName FROM schoolinformation WHERE schName LIKE '%$a%'";
- echo $sql;
- $i = 0;
- $result = mysqli_query($conn, $sql);
- while($rowval = mysqli_fetch_array($result))
- {
- $schName= $rowval['schName'];
- echo '<tr scope="col"><td align="center">'.$rowval['schName'].'</td>
- <td align="center"><input type="submit" id="shwData" name="shwData" class="btn" value="Show"/></td>';
- }
- echo '</table>';
- echo '</form>';
- if($schName == '')
- {
- echo "Entry not found";
- $flag = 1;
- }
- else
- {
- //echo $schName;
- $flag = 0;
- }
- ?>
- <?php
- if (isset($_POST['shwData']))
- {
- echo "this is it";
- }
- ?>
- $a = $_POST['findSchool'];
- session_start();
- if(isset($_POST['findSchool'])){
- $_SESSION['a'] = $_POST['findSchool'];
- }
- $a = $_SESSION['a'];
- $a = isset($_POST['findSchool']) ? 'Found '.$_POST['findSchool'] : '';
- echo $a;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement