<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Create php Requests From HTML form</title>
<script>
function InputList()
{
str = "";
phpRequest = "";
var myNodeList = document.querySelectorAll("input");
for (i=0 ; i < myNodeList.length ; i++) {
str += myNodeList[i].name+": "+myNodeList[i].value+"<br>";
phpRequest += '$'+myNodeList[i].name+' = $_REQUEST["'+myNodeList[i].name+'"]<br>';
}
document.getElementById("showlist").innerHTML = str+"<br>"+phpRequest;
}
</script>
</head>
<body>
<form name="mform" method="post" action="new.html">
<table align="center" style="width: 400px">
<tr>
<td>Name:</td>
<td>
<input name="T1" type="text">
</td>
</tr>
<tr>
<td>Email:</td>
<td>
<input name="T2" type="email">
</td>
</tr>
<tr>
<td>Mobile:</td>
<td>
<input name="T3" type="tel">
</td>
</tr>
<tr>
<td>Month:</td>
<td>
<input name="T4" type="month">
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input name="T5" type="password">
</td>
</tr>
<tr>
<td>Time:</td>
<td>
<input name="T6" type="time">
</td>
</tr>
</table>
<div align="center">
<input name="getlist" type="button" value="Get Object List" onclick="InputList()">
<input name="Reset1" type="reset" value="reset">
<input name="Submit1" type="submit" value="submit">
<p id="showlist"></p>
</div>
</form>
</body>
</html>