Jump to content

Recommended Posts

hi

I'm create a form and I connect it by database and when I submit the data the data is inserted correctly in the table ,but it's show me some wrings 

9mAXp9.jpg

this is HTML code

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<legend>
<form action="cccccccccc.php" method="post">
<label>user name
<input type="text" name="uname">
</label>
<label>pasword
<input type="password"name="pass">
</label>
<input type="submit">
</form>
</legend>
</body>
</html>

and this is php code

<!doctype html>

<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<?php
mysql_connect("localhost","root","")or die (mysql_error());
mysql_select_db("abubakerdb") or die (mysql_error());
$user=$_POST['uname'];
$pass=$_POST['pass'];
$query = mysql_query("insert into user_name (name , password)values('$user','$pass')")or die (mysql_error());
if($query)
{
	echo $user ."is added";
}
?>
</body>
</html>
Link to comment
https://forums.phpfreaks.com/topic/290707-php-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.