The Script <script> $(document).ready(function(){ $("#ContactForm").load("contactus/index.php?a=add"); }); </script> Code (markup): The Problem When I'm using that script, the page is called along with the script. But, the called PHP file can't function properly because it thinks that my root is that file directory. Example: contact.html calls contactus/submit.php Then index.php will consider directory of contact.html to be its directory. How to solve this problem so the index.php file will function properly.
So basically I need to place a PHP PAGE in my HTML PAGE. Now I'm trying to use <iframe scr="..."></iframe> It works. Now problem: How to maintain iframe height according to the PHP PAGE it called. The first iframe called a form in index.php?cs=add Then after submit button is clicked, the frame content changes to index.php?cs=submit with different height. I want it to automatically adjust height. Width is not the problem.
set <iframe src="......" style="width:100%;height:100%;"> first, see if that works. there's a couple of ways to solve this problem, but not all are trivial. - to load up your PHP content via AJAX in <body onload="ajaxCall()">, means search engines can't see the content that's provided by the PHP call. - to include your PHP content via php.net:b_start() (and related php functions), is possible (i do this in my framework by necessity), but a bit cumbersome compared with your current solution, an iframe (which does get seen by searchengine crawler programs)
although, if you have the iframe set to 100% and 100%, why do you still use an iframe, and not just a plain URL pointing straight to the "inner" PHP call?
uhmm. my thoughts exactly, why are you still using iframe. it's not a very good practice anymore in my opinion. please don't get me wrong.