Advertisement
Guest User

Untitled

a guest
May 11th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <meta charset="utf-8">
  2. <?php
  3.     print "Wpisz identyikator studenta";
  4.     print "<input type=text name=id_studenta><br>";
  5.     print "<input type=submit name=ok value='szukaj studenta' disabled>";
  6.     print "<form method=post action='zadanieDomowe1output.php'>";
  7.     $c = pg_connect("host=sbazy user=s200805 dbname=s200805 password=01234");
  8. $query="select id_studenta from studenci";
  9. $r=pg_exec($c,$query);
  10. $error=false;
  11. $arr=[];
  12. for($i=0;$i<pg_numrows($r);$i++){
  13.     $x=pg_result($r,$i,0);
  14.     array_push($arr,$x);
  15. }
  16.  
  17. for($i=0;$i<count($arr);$i++){
  18.     if($_GET['id_studenta']==$arr[$i]){
  19.         echo '<script type="text/javascript">',
  20.         'document.write("elo")',
  21.         '</script>'
  22.         ;
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement