Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
- <center>
- <H1>I. tehnička škola TESLA</h1><hr>
- <?php
- $id = $_GET["id"];
- $servername = "localhost";
- $username = "root";
- $password = "";
- $database = "baza";
- $conn = mysqli_connect($servername, $username, $password, $database);
- if (!$conn)
- {
- die("Greška prilikom spajanja na dB: " . mysqli_connect_error());
- }
- $sql = "SELECT * FROM korisnici WHERE ID='$id'";
- mysqli_query($conn, "SET NAMES'utf8'");
- $result = $conn->query($sql);
- $name="";
- $username="";
- $lozinka="";
- $akcija="Update";
- while($row = $result->fetch_assoc())
- {
- $name=$row["Name"];
- $username=$row["Username"];
- $lozinka=$row["Pass"];
- }
- ?>
- <form name="forma" action="insert.php" method="get">
- <input type="text" name="ID" value="<?php echo "$id";?>" />
- <input type="text" name="Name" value="<?php echo "$name";?>" />
- <input type="text" name="Username" value="<?php echo "$username";?>" />
- <input type="text" name="Pass" value="<?php echo "$lozinka";?>" />
- <input type="submit" value="Update">
- </form>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement