Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- </head>
- <body>
- <?php
- require 'konekcija.php';
- if(isset($_GET['mbr']))
- {
- $mbr=$_GET['mbr'];
- $broj=$_GET['broj'];
- echo '<a href="index.php?mbr='.$mbr.'&broj='.$broj.'">'.'<i><b>'
- .'Natrag-index'.'</i></b>'.'</a>'.'<br>';
- $query="select mbrStud,imeStud,prezStud
- from stud
- where mbrStud=$mbr";
- $result= mysqli_query($link, $query);
- $fetch= mysqli_fetch_assoc($result);
- if(isset($_POST['submit']))
- {
- $submit=$_POST['submit'];
- $ime=$_POST['ime'];
- $prezime=$_POST['prezime'];
- $stmt=$link->prepare("UPDATE stud SET imeStud=?, prezStud =? WHERE stud.mbrStud =?");
- $stmt->bind_param("sss",$ime,$prezime,$mbr);
- $status=$stmt->execute();
- if($status==TRUE)
- {
- echo '<a href="index.php?mbr='.$mbr.'&broj='.$broj.'">'.
- 'Izmjena podataka uspjela,vidi promjenu'.'</a>'.'<br>';
- echo '<table>';
- echo '<tr><td>'.'<i>'.$fetch['imeStud'].'</i>'.'<td>'.' je izmjenjeno u '.'<td>'.'<i>'.$ime.'</i>'.'<tr>';
- echo '<tr><td>'.'<i>'.$fetch['prezStud'].'</i>'.'<td>'.' je izmjenjeno u '.'<td>'.'<i>'.$prezime.'</i>'.'<tr>';
- echo '</table>';
- }
- else
- {
- echo '<br>'.'Došlo je do pogreške prilikom unosa podataka,pokušajte ponovo';
- }
- }
- }
- else
- {
- header('location:index.php');
- }
- ?>
- </body>
- <table>
- <form action="" method="POST">
- <tr><td>Ime:<td><input type="text" name="ime"
- value="<?php echo $fetch['imeStud'];?>"><tr>
- <tr><td>Prezime<td><input type="text" name="prezime"
- value="<?php echo $fetch['prezStud'];?>"><tr>
- <tr><td><input type="submit" name="submit" value="Izmjeni"><tr>
- </form>
- </table>
- </html>
Add Comment
Please, Sign In to add comment