Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" type="text/css" href="style.css">
- <title>TiTLe</title>
- </head>
- <body>
- <form action="tnjkp.php" method="GET">
- a:<input type="number" name="a"><br>
- b:<input type="number" name="b"><br>
- <input type="submit" value="wo">
- </form>
- <?php
- function suma($x, $y){
- $s=$x+$y;
- return $s;
- }
- if(isset($GET["a"]) && $_GET["a"]!="" &&_GET["b"]!=""){
- //polaczenie z baza danych:
- $serverName="localhost";
- $userName="root";
- $pass="";
- $dbName="prostokat";
- $conn=mysqli_connect($serverName,$userName,$pass,$dbName);
- if(!$)
- $wynik=suma($_GET["a"],$_GET["b"]);
- echo "<br> Wynik działania funkcji suma:".$wynik;
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement