Advertisement
Guest User

a

a guest
Dec 9th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!--
  3. To change this license header, choose License Headers in Project Properties.
  4. To change this template file, choose Tools | Templates
  5. and open the template in the editor.
  6. -->
  7. <html>
  8. <head>
  9. <meta charset="UTF-8">
  10. <title></title>
  11. </head>
  12. <body>
  13. <?php
  14. if(!isset($_GET['id']))
  15. {
  16. $f = 'korisnici.txt';
  17. $file = file($f);
  18. foreach ($file as $red)
  19. {
  20. $red=explode("\t",$red);
  21. echo'<p><a href="?id='.$red[0].'">' .$red[1].'</a></p>';
  22. }
  23. }
  24. else
  25. {
  26. $id=$_GET['id'];
  27.  
  28. echo'<h2>Detalji korisnika:</h2>';
  29. $f = 'korisnici.txt';
  30. $file = file($f);
  31. foreach($file as $red)
  32. {
  33. $red= explode("\t",$red);
  34. if($red[0]==$id)
  35. {
  36. foreach($red as $celija)
  37. {
  38. echo'<p>'.$celija.'</p>';
  39. }
  40. }
  41. }
  42. }
  43. ?>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement