EDIT! I see that many people are answering to my question, and thank you. But most of you are talking about some user name, which I do not get. I am actually using this example over here:
http : //people. cis.ksu .edu/~hankley/d764/tut06/GopisettyPHP.html
and am trying to make it using this reference. Over there is something completely different, cis-id, which I do not understand. Yes, I do not understand what the cis id is, which is in here:
$con = mysql_connect("sql107.freezoy.com","CIS-ID","REDACTED INFORMATION");
And also, many people are saying that I wrote name instead of Full Name and phone instead of Phone Number, but that is not referring to the table. The 'phone' and 'name' are the names I gave to the inputs in the HTML form.
Thanks, Kind Regards, Danish Humair
BACK TO THE OLD POST
Well, I am currently working on a website. Basically what happens is that you submit your name and phone number and it is inserted into the database. This may be a very 'newbie`ish' question, but I need your help.
Well, I made the table in the database and everything. Then I put this code into the HTML document:
<html>
<head>
<link rel="shortcut icon" href="main/shortcut_icon.ico" />
<link rel="stylesheet" href="main/common.css" />
<title>
Danish Core
</title>
</head>
<body>
<p class="title">
Welcome! Here is a simple form that uses PHP and MySQL!
</p>
<p>
Note: Please do not submit any sensitive information, as all that you submit will be saved into our database. Also, please do not spam by submitting irrelevant (or related) text.
</p>
<br />
<br />
<form action="insert.php" method="post">
Full Name:
<input type="text" name="name" />
<br />
<br />
Phone Number:
<input type="text" name="phone" />
<br />
<br />
<input type="submit" />
</form>
</body>
</html>
Well, and the 'insert.php' mentioned in the form's opening tag:
<html>
<body>
<?php
$con = mysql_connect("sql107.freezoy.com","frzoy_15640861_main","REDACTED INFORMATION");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("frzoy_15640861_main", $con);
$sql="INSERT INTO ClientInformation (name, phone)
VALUES
('$_POST[name]','$_POST[phone]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>
</body>
</html>
And here is a screen shot of my MySQL table:
https://i.stack.imgur.com/VGITc.png
And also my host's information:
https://i.stack.imgur.com/GA3vK.png
And the error is this: Could not connect: Access denied for user 'frzoy_15640861_main'@'192.168.0.40' (using password: YES)
I believe that it is most likely that the information to connect to the database was incorrect in the insert.php file. I have included the database information with the password redacted, so - if you could please help me with the trouble I am having thanks!
Thank you for reading! Kind Regards, Danish Humair