Jump to content

Notice: Undefined index: name


mdvignesh

Recommended Posts

I got this error when i click update button

 

Notice: Undefined index: name in C:\wamp\www\mariyano\New Folder - Copy\New\update.php on line 14

 

Notice: Undefined index: mobile in C:\wamp\www\mariyano\New Folder - Copy\New\update.php on line 14

 

Notice: Undefined index: email in C:\wamp\www\mariyano\New Folder - Copy\New\update.php on line 14

Unknown column 'diwakar' in 'where clause'

 

<?php

$cn=mysql_connect("localhost","root","");
mysql_select_db("super",$cn);

if(isset($_POST['submit']))
{
	//checks cookies to make sure they are logged in 
	if(isset($_COOKIE['ID_my_site'])) 
	{ 
	$username = $_COOKIE['ID_my_site']; 

$qy="UPDATE users SET name='$_POST[name]',  email='$_POST[mobile]',  city='$_POST[email]' WHERE username=$username ";

mysql_query($qy,$cn) or die(mysql_error());
}
}

?>

 

 

 

<?php
$cn=mysql_connect("localhost","root","");
mysql_select_db("super",$cn);

//checks cookies to make sure they are logged in 
if(!isset($_COOKIE['ID_my_site'])) 
{
header("Location: login.php");
}

echo "<h3>Profiles</h3><br/><br/>";
echo "Name: <input type=\"text\" name=\"name\" > ";
echo "<br/>";

echo "Email: <input type=\"text\" name=\"email\"> ";
echo "<br/>";
echo "City: <input type=\"text\" name=\"city\"> ";

//echo "<br/><br/><input type=\"submit\" value=\"Update\" >";
//echo "<br/><br/><a href=logout.php>Logout</a>"; 
?>

<html>

<form action='update.php' method='post'>
<br/>
<input type='submit' name='submit' value='Update' >

<br/><br/><a href=logout.php>Logout</a>
</form>

</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.