Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-10-2004, 09:07 PM   #1
Senior Member
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
simple q: can you use php inside an html document?

I know you can make a php script (program?) spit out html, but if I have an html file & want to do a little php script, can I?

case in point: I've written some php code that displays a random image & I'd like to use that on my webapge. the webpage is in html.. I'm looking for a quick solution that doesn't involve redoing the whole page. Is there one?

Old 12-10-2004, 09:12 PM   #2
Senior Member
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
hmm... guess I asked too soon. I just renamed my index.html to index.php & enclosed to php in <?php ... ?>

seems to work.

If this isn't a good idea, let me know.
Old 12-10-2004, 09:31 PM   #3
Registered: Aug 2003
Location: Seattle, Wa
Distribution: Fedora,Trustix,Debian
Posts: 290

Rep: Reputation: 30
Thats probably the best idea unless you want to change the server parameters to load html documents as php documents into the interpreter but thats too much of a head ache and this will work out better anyway


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple PHP / HTML frames question Mq2004 Linux - Software 2 05-04-2005 10:36 AM
changeing default document from index.html in apache thebover Linux - Software 3 03-30-2005 09:26 PM
Fooling a HTML document? eantoranz Programming 11 11-11-2004 07:42 AM
Simple php script with html form not working. sinsoush Programming 4 04-01-2004 08:02 PM
Creating a simple html page from php? lucastic Linux - General 4 11-05-2003 08:48 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration