I am trying to build a basic php mysql website, but i am not getting desired output when executing the php function on clicking the button.
html code
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>NewWeb</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div class="container">
<h3>
NewPHP
</h3>
<form action="index.php" method="post">
<input type="text" name="name" id="name" placeholder="enter your name pleas please">
<input type="text" name="age" id="password" placeholder="enter your name pleas please">
<input type="email" name="email" id="email" placeholder="email">
<button class="btn">SUBMIT</button>
</form>
</div>
<script src="index.js"></script>
</body>
</html>
php code
<?php
$server = "localhost";
$username = "root";
$password = "";
$con = mysqli_connect($server,$username,$password);
if(!$con){
die("Connection to database is failed due to".mysqli_connect_error());
}
echo "Successful Connection To The Database";
?>
upon clicking the button I am getting the output of php script only.
I am new to learning php websites. I am using XAMPP server in mac machine.
Please guide me for the issue.
Aucun commentaire:
Enregistrer un commentaire