I want your help with the following issue:
I've tried to submit a form without reloading my page, but without success. I've read other relative questions but i can't do it.
I want the following: When a user clicks on the button, then the data should be sent to server without displaying an OK messsage. Can you help me? Here is my code:
index.html
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<p align="center">Example</p>
<table align="center" width="730" border="0">
<tr>
<td align="center">
<div>
<table class="blueTable" style="float: left">
<thead>
<tr>
<th colspan="1"><u>Menu</u></th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="button" value="New" id="new" onclick="new1();" class="button12"/></td></tr>
<tr>
<td><input type="button" value="Load" id="load" onclick="load2()" class="button"/></td></tr>
<tr>
<td><form name="SaveGame" id="SaveGame" method="post" action="http://127.0.0.1/PHP/mine2.php" enctype="multipart/form-data">
<input type="submit" value="Save" id="save" onclick="save3()" class="button"/>
</form>
</body>
</html>
mine2.php
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
$link = mysqli_connect("127.0.0.1", "root", "", "mysql3");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
// Attempt insert query execution
$sql = "INSERT INTO components (user_id, book_id, game_id, site_id) VALUES ('6', '6', '6', '6')";
if(mysqli_query($link, $sql)){
} else{
}
// Close connection
mysqli_close($link);
?>