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>1. tehniฤka ลกkola TESLA</h1><hr>
- <?php
- //user id
- $id = $_GET["id"];
- //konekcija
- $servername = "localhost";//server
- $username = "root";//korisnicko ime
- $password = "";//lozinka
- $database = "baza";//ime baze
- $conn = mysqli_connect($servername, $username, $password, $database);
- if(!$conn)
- {
- die("Spajanje nije uspijelo:". mysqli_connect_error());
- }
- else
- {
- echo "Spajanje na dB uspijesno!<br>";
- }
- $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="pusername" value="<?php echo "$username";?>" />
- <input type="text" name="pass" value="<?php echo "$lozinka";?>" />
- </form>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement