I'm using javascript to populate input text fields in a form inside the iframe. Then I programmatically submit the form to itself, the iframe, which has PHP code at the top to update data in the database. When I inspect element network I can see the posted data, but it's not getting into the data base. I have error reporting turned on but I'm not getting any errors. Sorry I don't have the code in front of me to post.
I have included the database connection in the iframe aswell, not sure if the included database from the parent window is also passed to the child iframe.
Thanks for the help!
The iFrame would need the database connection as well. adding that should help however still odd your IFrame is not throwing a no database connection error.
Is your PHP wrapped in some form of
if(isset($_POST)){ //connect to database, run mysql query }
If you are not getting PHP errors, investigate mysql for the last error and print that to page via mysqli_error.
Also worth noting that PHP processes everything on the server and delievers the output as a HTTP response to the browser. The Iframe is in that response, so nothing in the parent PHP document outputting the HTML containing the iframe will be passed to any PHP document outputting HTML that is inside the iframe.
If you do want to do that, look into PHP sessions and it only will work for an iframed document on the same server as the iframing document.