473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

<?php in .html files ??

sorry newbie:
1. is it that <?php (stuff) ?> will NOT work in my index.html file ?

I can get <?php stuff to work in a .php file,
but its ignored when in a .html file.

This is just normal right ?
sorry, thanks
Jul 17 '05 #1
3 2160
test wrote:
I can get <?php stuff to work in a .php file,
but its ignored when in a .html file. This is just normal right ?


Yes, very normal.

But you can configure your HTTP server to pass whetever pages you want
to the PHP engine.
Check "AddType" for Apache's httpd.conf

For example:
AddType application/x-httpd-php .php .phtml .html .script

will serve php from files ending in .php, .phtml, .html, and .script
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
test uttered the immortal words:
sorry newbie:
1. is it that <?php (stuff) ?> will NOT work in my index.html file ?
Will only work if the webserver has been told to send .html files to PHP.
I can get <?php stuff to work in a .php file,
but its ignored when in a .html file.

This is just normal right ?


Yep. Visit http://www.php.net

--
Andy.
Jul 17 '05 #3
tom
Pedro Graca wrote:
test wrote:
I can get <?php stuff to work in a .php file,
but its ignored when in a .html file.

This is just normal right ?


Yes, very normal.

But you can configure your HTTP server to pass whetever pages you want
to the PHP engine.
Check "AddType" for Apache's httpd.conf

For example:
AddType application/x-httpd-php .php .phtml .html .script

will serve php from files ending in .php, .phtml, .html, and .script


thanks - I've been ages on this;
least I know my php.ini, httpd.conf and freebsd conflicts better;
corrected name now,
many thanks
tom
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
7
by: Jose Cuthberto | last post by:
WRAPPER CODE FOR A SET OF HTML FILES, AND BUTTON BAR LOOKS LIKE BELOW: |< < <> > >| => <= O' (magnifying glass for small gif text) I have a number of isolated html files for a 1000 page...
3
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
4
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
9
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash...
3
by: Yash | last post by:
Hi all, I found that while we are updating our application, the application is not known to tomcat, untill it is completed. So tomcat sends 503 page as resource not found. I want to know is...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.