Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>New rule</title>
- <link type="text/css" rel="stylesheet" href="stylesheet.css" />
- </head>
- <body>
- <?php
- if ($_SERVER['REQUEST_METHOD'] === 'POST')
- {
- echo "is post";
- if (isset($_POST['btnDelete']))
- {
- "button pressed"
- }
- else
- {
- echo "no button press";
- }
- }
- function drawGroupDropDown()
- {
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "dcqa";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT * FROM groups";
- $result = $conn->query($sql);
- echo "<select name='groups'>";
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo "<option value='" . $row['names']. "'>".$row['names']."</option>";
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- echo "</select>";
- ?>
- <form action="rules.php" method="POST">
- Rule:
- <input type="text" name="rule"/>
- <br/>
- <br/>
- Group:
- <?php drawGroupDropDown() ?>
- <br/>
- <br/>
- Rejecable by DC?
- <select name='rejectable'>
- <option value="true">Yes</option>
- <option value="false">No</option>
- </select>
- <br />
- <br />
- <button type="submit" value="submit">Add rule</button>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement