Re: PHP within HTML iFrame
| From: | Marek Kilimajer | Date: | Wed, 23 Apr 2003 10:35:38 +0000 |
| Subject: | Re: PHP within HTML iFrame | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144987@lists.php.net to get a copy of this message | ||
the config file is usualy /etc/httpd/conf/httpd.conf
Marek Kilimajer wrote:
Andrew G wrote:I am trying to devise a way to create meta-tag keywords dynamically with javascript or PHP, but the catch is I need to retain the files original extension of '.html'In apache config file (usualy ) find line containing AddType application/x-httpd-php and add .html to the list of extensions and restart apacheI have done a PHP sendmail app using an iFrame successfully, so i was wondering (outloud) if the same thing could work for this. I did a nice javascript routine (below) before I realized that 'document.write(keywords);' does me no good for search-engines (or does it?),no, search engines would have to execute javascript for this to workbecause I need the keywords to appear in the source code. So, does anyone have any opinions about how to do this? Is there any merit to my iFrame idea? Is there a such thing as a PHP include within an .html file? Thanks anyone and everyone! <script language="JavaScript"> //create keywords from title var title = "[-- PRODUCT.name REMOVE_HTML --]"; // this is a variable spit out by my shopping cart when the html page is generated var keys = new Array(); var stringEnd = title.lastIndexOf(" "); i = 0; firstChar = 0; lastChar = 0; while(lastChar < stringEnd) { lastChar = title.indexOf(" ", firstChar); lastChar -= 1; keys[i] = title.subString(firstChar, lastChar); firstChar = lastChar + 2; i += 1; } var newKeywords = ""; for (var i = 0; i < keys.length; i++) { newKeywords = newKeywords + ", " + keys[i]; } document.write("<meta name='keywords' content='" + newKeywords + newKeywords + "TIVO,Television,Plasma,digital camera,camcorders,Polk Audio,home theater,projection,speaker,reciever,DVD,VCR,MP3'>"); </script>