Hi guys I can't do this simple thing, please help me. This is my htm file http://www.globalcashsite.com/onlineinvestment.htm This is my php file http://www.globalcashsite.com/manager/allmonitoredsites.php I tried <? include command ?> I also tried In frontpage Insert, webcomponent, advance control, html and then <? include command ? I want to add this .php into .htm file, please let me know how to do this. GCS
You can add PHP to an html file! Just use the include command like above, but you also need to place something in the .htaccess file of that directory:
no my friend.. for seo purposes, people like to set php files work as .html.. i mean actually they are php files but will open on the browser if we set .htacess settings to treat .php files as .html.. because then search engines will take it as static page and static pages are always good for good search engine rankings.. you cannot include a php file into .htm file.. Infact, the tags he is trying to use to include are php tags, that not works in html.. he is using <? ?> to include.. these tags are for .php files..
no, this is not strange.. actually, php is dynamic server side programming language.. and HTML is static client side code.. server not understand .html, it just throws .html code to the browser.. and server understands server side scripting php and convert or compile or interpret it into some other code that browser can understand, that code can be html, sometimes xml, depends what php programming want to display or writing to browser.. html file exists on browser, and php resides on server, html cannot include php.. but php can include html on server side and then at once can through the final result to browser that browser can understand.. but there is one way if you want to include something in html from php file, then my expert advice to you is to use AJAX (asynchronous javascript and xml).. code an smart javascript in your html file, that javascript will call php file without let the browser refresh, and php file will get executed on server side and will through the output of php file into the browser, then without the page refresh, javascript will get response from the php file output that you can use or include in your html file using javascript..
u can give it a professional look by not displaying the iframe borders and take care of the height and width.
You're giving a bunch of false information. You CAN include a PHP file into an HTML file, I've done it many times and for several of my clients. Doing what I stated above alone will allow you to include PHP commands in an HTML document. If you didn't notice the ".php" section in the .htaccess line: And as for SEO, I really have a hard time assuming that search engines give preference to HTML-only websites, and in either event, the browser or search engine crawler doesn't even see that it's PHP code because the server parses it and spits out HTML for the browser to understand and layout. The iframe is most likely what will cause SEO problems, not PHP.
You type this into your .htm file. <?PHP include_once("example.php"); ?> Make sure your files are in the correct place (same directory) though or you get an error and make sure in your PHP file you have open and closing php tags.
using your suggested way, you can only execute a php file from html, but you cannot include.. there is a difference between execute and include concept..
Yes mate, you are right.. here is the detailed tutorial about this; http://php.about.com/od/advancedphp/p/html_php.htm
Hi buddy I added this into .ht file but when I opened my .htm page browser don't display page instead a page save window open to save this page. What is problem here? And I am getting this error where I included php file [an error occurred while processing this directive] GCS