SHARE
TWEET

Untitled

a guest May 23rd, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="pl">
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="stylesheet" type="text/css" href="style.css">
  6. <title>TiTLe</title>
  7. </head>
  8. <body>
  9. <form action="tnjkp.php" method="GET">
  10. a:<input type="number" name="a"><br>
  11. b:<input type="number" name="b"><br>
  12. <input type="submit" value="wo">
  13. </form>
  14. <?php
  15. function suma($x, $y){
  16.     $s=$x+$y;
  17.     return $s;
  18. }
  19. if(isset($GET["a"]) && $_GET["a"]!="" &&_GET["b"]!=""){
  20.     //polaczenie z baza danych:
  21.     $serverName="localhost";
  22.     $userName="root";
  23.     $pass="";
  24.     $dbName="prostokat";
  25.  
  26. $conn=mysqli_connect($serverName,$userName,$pass,$dbName);
  27. if(!$)    
  28.     $wynik=suma($_GET["a"],$_GET["b"]);
  29.     echo "<br> Wynik działania funkcji suma:".$wynik;
  30. }
  31. ?>
  32. </body>
  33. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top