I try to upload php file with my site to get data from form,its running perfect but its shows error when its live.
The Error is: Warning: mysqli_connect(): (HY000/1044): Access denied for user 'ideamak1_sagar'@'%' to database 'ideamak1_data' in /home/ideamak1/public_html/afterform.php on line 12 ERROR: Could not connect gh.
Here's my php code
<!DOCTYPE html>
<head>
</head>
<body>
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$contact = $_POST['contact'];
$comment = $_POST['comment'];
$link = mysqli_connect("localhost",
"ideamak1_sagar", "Jmtm,?j4T(ZD",
"ideamak1_data") or die("ERROR: Could
not connect gh. ");
if(isset($_POST['name']) &&
isset($_POST['email'])){
$sql = "INSERT INTO user (name, email,
contact, comment) VALUES ('$name',
'$email', '$contact', '$comment')";
$result = mysqli_query($link, $sql) or
die("ERROR: Could not connect. ");
mysqli_close($link);
?>
<h1>Thank You for Contacting Us <?php
echo "<span
style='color:purple;'>$name</span>" ?>
</h1>
<h3>We will be contacting you
soon</h3> <a href="index.html">Click
here for redirecting site..</a
<?php
}else{
?> <p>Your account have been not
registered yet.</p>
<a href="index.html">Click here
for redirecting site..</a>
<?php }?>
</body>
</html>