A
ant M
Guest
Hello im trying to update the values of a form using php my current code is this
<html>
<head>
<?php
function provincias($mes)
{
$mes = $_POST["month"];
$provinces = array("jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dic");
echo $provinces[$mes];
}
provincias($mes)
?>
</head>
<body>
<form id="monthForm" name="monthForm" method="post" action="monthAbbrev.php">
<p>Enter the number for the month of the year here (0 is January):**
<input type="text" id="month" name="month" /></p>
<p>
<input type="submit" value="What is the abbreviation?" name="submit" />
</p>
<p>Answer:*<input type="text" id="abbrev" name="abbrev" /></p>
</form>
</body>
</html>
So basically the user enters a number and that is mapped into the array and it gets the month which needs to be written in the answer textbox
I know how to the the values using POST but is there a way to return the value and write it in the text box?
Thanks
<html>
<head>
<?php
function provincias($mes)
{
$mes = $_POST["month"];
$provinces = array("jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dic");
echo $provinces[$mes];
}
provincias($mes)
?>
</head>
<body>
<form id="monthForm" name="monthForm" method="post" action="monthAbbrev.php">
<p>Enter the number for the month of the year here (0 is January):**
<input type="text" id="month" name="month" /></p>
<p>
<input type="submit" value="What is the abbreviation?" name="submit" />
</p>
<p>Answer:*<input type="text" id="abbrev" name="abbrev" /></p>
</form>
</body>
</html>
So basically the user enters a number and that is mapped into the array and it gets the month which needs to be written in the answer textbox
I know how to the the values using POST but is there a way to return the value and write it in the text box?
Thanks