LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-10-2004, 09:07 PM   #1
BrianK
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?

Thanks
 
Old 12-10-2004, 09:12 PM   #2
BrianK
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
zatriz
Member
 
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
 
  


Reply


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


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

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