I could not find a solution, please help. Below is the code. thanks in advance
<?php
if(isset($_POST['submit'])){
$name = $_POST['name'];
$Lname = $_POST['lastName'];
$num = $_POST['number'];
echo $name.$Lname.$num;
$xml = new SimpleXMLElement("<?xml version='1.0' encoding='UTF-8'?><Person></Person>");
Header('Content-type:text/xml');
$name = $xml->addChild('name',$name);
$Lname = $xml->addChild('LastName',$Lname);
$Number = $xml->addChild('Number',$num);
print($xml->asXML());
}
?>
<!DOCTYPE html>
<head>
<title>XML</title>
</head>
<body>
<form method="post" action="" enctype= multipart/form-data>
<input type="text" name="name" value="Name" required/>
<input type="text" name="lastName" value="LName" required/>
<input type="text" name="number" value="Number" required/>
<input type="submit" value="send" name="submit"/>
</form>
</body>
</html>
I could not find a solution, please help. Below is the code. thanks in advance
source
share