-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_user_xml.php
34 lines (26 loc) · 912 Bytes
/
edit_user_xml.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
<?php
include("login_functions.php");
include("connect.php");
if(loggedin()){
header("Content-type:text/xml;charset=utf-8");
echo '<?xml version="1.0"?>';
echo '<?xml-stylesheet type="text/xsl" href="edit_user.xsl"?>';
echo "<user>";
$admin = $_SESSION['username'];
echo "<admin>$admin</admin>";
$XMLcontent = "";
$username = $_GET['username'];
$query = "SELECT * FROM user WHERE Username='$username'";
$result = mysql_query($query) or die("Query failed.");
while ($row = mysql_fetch_object($result)){
$mail = $row->Mail;
$pwd = $row->Password;
$XMLcontent = $XMLcontent . "<username><![CDATA[$username]]></username>";
$XMLcontent = $XMLcontent . "<password><![CDATA[$pwd]]></password>";
$XMLcontent = $XMLcontent . "<mail><![CDATA[$mail]]></mail>";
}
echo utf8_encode($XMLcontent);
echo "</user>";
}
else header("Location: index.php");
?>