Edit funtion in PHP
<?php
error_reporting(0);
include("db.php");
$editId;
if($_REQUEST['id'] != ""){
$id = $_REQUEST['id'] ;
$GLOBALS[$editId] = $id;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit Document</title>
<script type="text/javascript">
function editDone(){
<?php
$id = $_REQUEST['name'];
$email = $_REQUEST['email'];
$password = $_REQUEST['password'];
echo "id = $id + email = $email + pass = $password";
?>
}
</script>
</head>
<body>
<table>
<tr>
<td>Name</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td>
<input type="submit" value="Edit Record" onclick="editDone();" />
</td>
</tr>
</table>
</body>
</html>
error_reporting(0);
include("db.php");
$editId;
if($_REQUEST['id'] != ""){
$id = $_REQUEST['id'] ;
$GLOBALS[$editId] = $id;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit Document</title>
<script type="text/javascript">
function editDone(){
<?php
$id = $_REQUEST['name'];
$email = $_REQUEST['email'];
$password = $_REQUEST['password'];
echo "id = $id + email = $email + pass = $password";
?>
}
</script>
</head>
<body>
<table>
<tr>
<td>Name</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td>
<input type="submit" value="Edit Record" onclick="editDone();" />
</td>
</tr>
</table>
</body>
</html>
Comments
Post a Comment