Created
January 10, 2012 12:22
-
-
Save klang/1588773 to your computer and use it in GitHub Desktop.
html array send to php action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<header> | |
<script type="text/javascript"> | |
function btnClick(aBtn) { | |
with (aBtn.form) { | |
event.value = aBtn.name; | |
submit(); | |
} | |
} | |
</script> | |
</header> | |
<body> | |
<form name="choiceForm" method="post" action="foo.php"> | |
<input type=hidden name="module" value="this_one"> | |
<input type=hidden name="event" value=""> | |
<input type=text name="entries[]" value="val1"><br> | |
<input type=text name="entries[]" value="val2"><br> | |
<input type=text name="entries[]" value="val3"><br> | |
<input type=text name="entries[]" value="val4"><br> | |
<input type=text name="entries[]" value="val5"><br> | |
<input type=text name="entries[]" value="val6"><br> | |
<button type="button" name="save_entries" onClick="btnClick(this)">Save entries</button> | |
<input type="submit" name="Submit" value="Submit"> | |
</form> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
print"<pre>module:\n".print_r($module, true)."</pre>"; | |
print"<pre>event:\n".print_r($event, true)."</pre>"; | |
print"<pre>entries:\n".print_r($entries, true)."</pre>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment