Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form target="iframe_b" action="/php_src/first.php" method="POST"
- echo "sending data">
- fieldset>
- <legend style="font-size:150%"><b>send MTData</b></legend>
- <br><br>
- <input type="button" id="select_all" name="select_all" value="Select All">
- <input type="button" id="de_select_all" name="de_select_all" value="DeSelect All">
- <br><br>
- <input type="submit" value="Submit">
- <?php
- $dbhost = 'localhost:3036';
- $dbuser = 'root';
- $dbpass = 'XXXX';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass);
- if (!$conn) {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("ApplicationServer") or die(mysql_error());
- // Get all the data from the "example" table
- $result = mysql_query("SELECT EXTERNAL_ID,CONNECTION_STATUS FROM DEVICE_DETAILS") or die(mysql_error());
- echo "<table border='1'>";
- echo "<tr><th>Selection</th> <th>External ID</th> <th>Device status</th> <th>MT data<th> </tr>";
- while ($row = mysql_fetch_array($result)) {
- // Print out the contents of each row into a table
- $temp = $row['EXTERNAL_ID'];
- echo "<tr><td>";
- echo "<input type="checkbox" id="id_extID" name="yourCheckboxName".$temp."" />";
- echo "<td>";
- echo $row['EXTERNAL_ID'];
- echo "</td><td>";
- echo $row['CONNECTION_STATUS'];
- echo "</td><td>";
- echo "<input type="textbox" name="textboxName".$temp."" size="50" value = "$temp._data" />";
- echo "</td></tr>";
- }
- echo "</table>";
- mysql_close($conn);
- <script type="text/javascript">
- $('#select_all').click(function() {
- $('#id_extID option').prop('selected', true);
- });
- $('#de_select_all').click(function() {
- $('#id_extID option').prop('selected', false);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement