I have written piece of code, below is the code
<script type="text/javascript">
function submitform()
{
document.myform.action='http://mysite/index.php';
document.myform.submit();
}
</script>
<?php
if(isset($_POST['submit_details']))
{
echo "<script typ=javascript> submitform();</script>";
}
?>
<form id="myform">
------
------
<input type="submit" name="submit_details">
</form>
when i try to submit the form , it gives me error document.myform is undefined, how to solve this error
<form action="http://mysite/index.php" method="GET">
and if this is index.php, then your PHP will automatically submit the form again... and again... and again... – Herbert Oct 12 '11 at 18:09