Ive got a page which has a div set to hidden. in the div is an iframe which contains a small form. Using javascript on the parent page you can click a link that unhides the div showing the form. you can also click outside the div to hide it again using a simple javascript function i call hideForm(). For the form thats in the child window (the iframe) i want that when you click submit the form submits to itself, does the needed code, then refreshes the form and hides it again ready and waiting for when its called up again. I will simplify my code here. What is wrong with it is that it hides the div calling on the javascript in the parent window. but doesnt refresh the iframe page named contact.php.
found this error in my logs
[07-Oct-2013 09:03:42] PHP Warning: Cannot modify header information - headers already sent by (output started at /**************/contact.php:91) in /home1/elfproth/public_html/gspdesign/contact.php on line 95
on line 95 was where my html code has its <head> element
Code: Select all
<?php
if(isset($_POST['send'])){
/*if errors exist return to form using header('Location:contact.php');die();
if not then run the things needed. this works*/
echo "<script language='javascript'>window.parent.hideForm();</script>"; //this works as well
header('Location:contact.php');die(); //this doesnt work... just tested removing the javascript and this then works. but not when the javascript is enabled
}
?>
<form action="contact.php" method="post">
<!-- form elements -->
<input type="submit" name="send" />
</form>
}