Im trying to create a form that posts the information from the form into the database. But my coding doesn't work! May someone please help me? Here's the code:
This is the refund.php
file with the form:
<?php
include "../autoload.php";
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" class="ui" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../assets/css/main5.css" media="screen">
<meta charset="utf-8">
<title>Refund site</title>
</head>
<body>
<div class="admin-panel">
<div class="content">
<h1>Refund</h1>
<br>
<a href="index.php">Back</a>
<br>
<form class="refund" action="insert.php" method="post">
<i class="fa fa-user" aria-hidden="true"></i><input type="text" name="username" value="" placeholder="Username"><br><br>
<i class="fa fa-list" aria-hidden="true"></i><input type="email" name="email" value="" placeholder="email"><br><br>
<i class="fa fa-list" aria-hidden="true"></i><input type="text" name="kontonummer" value="" placeholder="phone"><br><br>
<button type="submit" name="post_news">Send</button>
</form>
</div>
</div>
</body>
</html>
And this is the insert.php
file where the execution happens:
<?php
include "../autoload.php";
if (isset($_POST['refund'])) {
$username = $_POST['username'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$refund = new refund();
$refund->post_news($username, $email, $phone);
}
?>
Can someone please help me with what's wrong? Need help Quick!
Regards, Henry