Update OOP

<?php

 include_once ('all.php');
 $updatedata = new Databases;

if(isset($_GET['id']))
{
$id = $_GET['id'];

if(isset($_POST['update']))
{
$name=$_POST['name'];
$username=$_POST['username'];
$password=$_POST['password'];

$up=$updatedata->update($id,$name,$username,$password);

if($up)
{
echo "<meta http-equiv='refresh' content='0; url=select.php'>";
}
else
{
echo "Didnt Update";
}
}

$vfurow=$updatedata->viewforup($id);

?>

<html>

<head>

</head>

<body>

<form action="" method="POST">
Name : <input type="text" name="name" value="<?php echo $vfurow['name'] ?>"> <br><br>
Username : <input type="text" name="username" value="<?php echo $vfurow['username'] ?>"> <br><br>
Password : <input type="text" name="password" value="<?php echo $vfurow['pw'] ?>"> <br><br>
<input type="submit" name="update" value="Update"> <br><br>
</form>

<?php
}
?>

</body>
</html>

0 comments:

Tweet Now !!

Recommend us on Google!