-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathedit.php
52 lines (45 loc) · 1.19 KB
/
edit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?
$link = mysql_connect('customer0.db.11252176.hostedresource.com', 'customer0', 'Ahmed@123');
if (!$link) {
die('Not connected : ' . mysql_error());
}
// make the current db
$db_selected = mysql_select_db('customer0', $link);
if (!$db_selected) {
die ('Can\'t use foo : ' . mysql_error());
}
?>
<?
$user = $_POST['user'];
$id = $_POST['id'];
$select = mysql_query("SELECT * FROM `database` where name='$user' AND id = '$id' ");
while($r = mysql_fetch_assoc($select)){
echo $r['username']."<br>";
echo $r['password']."<br>";
echo $r['link']."<br>";
}
echo "
<table>
<tr><td><form action=\"\" method=\"POST\">
<label>PMA User : </label>
<input type=\"text\" name=\"PMAU\" >
<label>PMA PASS: </label>
<input type=\"text\" name=\"PMAP\" >
<label>PMA Link: </label>
<input type=\"text\" name=\"PMAL\" >
<input type=\"submit\" name=\"update\" value=\"update\">
</form></td></tr>
</table>";
if(isset($_POST['update'])){
$id = $_POST['id'];
$PMAU = $_POST['PMAU'];
$PMAP = $_POST['PMAU'];
$PMAL = $_POST['PMAU'];
$update = mysql_query("UPDATE `database` SET username='$PMAU', password='$PMAP', link='$PMAL' WHERE id='$id'");
echo $update;
var_dump($update);
if($update){
echo "Successfully Updated ! ";
}
}
?>