-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayq.php
71 lines (47 loc) · 1.19 KB
/
payq.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
$xml= new DomDocument("1.0","UTF-8");
$xml->formatOutput=true;
$xml->preserveWhiteSpace=false;
$xml->load("paymentsxml.xml");
if (!$xml) {
$paymentsxml=$xml->createElement("paymentsxml");
$xml->appendChild($paymentsxml);
}
else
{
$paymentsxml=$xml->firstChild;
}
if (isset($_POST['submit'])) {
$rno=$_POST['rno'];
$cost=$_POST['cost'];
$ssn=$_POST['ssn'];
$payments=$xml->createElement("paymentsxml");
$paymentsxml->appendChild($payments);
$reciptno=$xml->createElement("Payments",123);
$payments->appendChild($reciptno);
$cost=$xml->createElement("cost",120000);
$payments->appendChild($cost);
$pussn=$xml->createElement("ssn",3763);
$payments->appendChild($pussn);
echo "<xmp>".$xml->saveXML()."</xmp>";
$xml->save("paymentsxml.xml");
}
?>
<?php
$server="localhost";
$uname="root";
$pw="";
$dbname="liot";
$conn= mysqli_connect($server,$uname,$pw,$dbname);
$rno=$_POST['rno'];
$cost=$_POST['cost'];
$ssn=$_POST['ssn'];
$sql = "INSERT INTO payment(recipt_no,cost,pussn) VALUES ('$rno','$cost','$ssn')";
if ($conn->query($sql) === TRUE) {
echo "Record inserted successfully";
}
else {
echo "Error insering record: " . $conn->error;
}
$conn->close();
?>