Hello,
I am currently using the following code:
<?php
include('includes/config.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</head>
<body>
From this page, you can search for server names. You do not have to use a Wildcard. I've done that for you. :)
<br /><br />
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Server Search: <input type="text" name="term" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php
if (isset($_POST['submit'])) {
$term = $_POST['term'];
$sql = "SELECT * FROM tblDeviceListing WHERE SystemName LIKE '%".$term."%'";
$r_query = sqlsrv_query($conn, $sql);
/*
while ($row = mssql_fetch_array($r_query)) {
echo 'System Name: ' .$row['SystemName'];
}
*/
while( $row = sqlsrv_fetch_array( $r_query, SQLSRV_FETCH_ASSOC) ) {
echo $row['SystemName']. " - ".$row['Location']." - ".$row['Services']. " - " .$row['PrimaryIPAddress']. " - " . $row['iLOAddress']. " - " .$row['RackNumber']."<br />";
}
}
?>
</body>
</html>
however, I want, when they click Search to just display the data in the same div it’s already in, and not refresh the whole page.
Thanks in advance.