Jump to content


Photo

embeding PHP into HTML


  • Please log in to reply
7 replies to this topic

#1 Tung_meister

Tung_meister

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 02 April 2005 - 10:50 AM

hello, do i need to change any of the servers configuration to enable embedded php script to function within a html page?atm if i embed php script into a html file all i get displayed is the raw php or a blank page.

#2 olajideolaolorun

olajideolaolorun

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 2,348 posts
  • Gender:Male
  • Location:Atlanta, GA
  • SourceForge IDempirex
  • Wiki ID: olajideolaolorun
  • IRC Nickname: Olajide
  • Main OS: Windows 10

Posted 02 April 2005 - 12:06 PM

You probably need to edit the httpd.conf file or php.ini file for that.

You have to add the extension along with the others....

#3 MrX

MrX

    The Mad Theorist

  • Support Team
  • PipPip
  • 167 posts
  • Location:IRC :P
  • Wiki ID: MrX
  • IRC Nickname: MrX, MrX- and MrX_

Posted 02 April 2005 - 11:06 PM

Did you give the file a .php extension?

#4 olajideolaolorun

olajideolaolorun

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 2,348 posts
  • Gender:Male
  • Location:Atlanta, GA
  • SourceForge IDempirex
  • Wiki ID: olajideolaolorun
  • IRC Nickname: Olajide
  • Main OS: Windows 10

Posted 02 April 2005 - 11:39 PM

No he is talking about embedding php into HTML... there is a way to do that using either the .html extension or .phtml :(

Check those config files :D

#5 olajideolaolorun

olajideolaolorun

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 2,348 posts
  • Gender:Male
  • Location:Atlanta, GA
  • SourceForge IDempirex
  • Wiki ID: olajideolaolorun
  • IRC Nickname: Olajide
  • Main OS: Windows 10

Posted 03 April 2005 - 12:12 AM

Take a look:
http://www.faqts.com...aid/9546/fid/51

#6 Tung_meister

Tung_meister

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 04 April 2005 - 05:54 AM

thanks for the help but i worked out what to do afew hours after i made the post :(

#7 gopo

gopo

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 04 April 2005 - 10:05 AM

For those who want to have this feature, there is a simple shortcut and it dosen't require to cahnge your http.conf. Just add this line to the .htaccess file:

addtype application/x-httpd-php .html .htm .bla

You can add wathever you might want to, even something crazy, like .bla, your name or your nickname.

In other words, personlize your site. If you do have.... personality. :(

#8 AlleyKat

AlleyKat

    Project Helper

  • Super Moderator
  • PipPip
  • 84 posts
  • Location:Odense, Denmark
  • SourceForge IDdk_alleykat
  • IRC Nickname: (@)AlleyKat :P

Posted 07 April 2005 - 10:10 PM

If needed server-wide:
I'd say in W:\usr\local\apache2\conf\httpd.conf
Find:
AddType application/x-httpd-php .phtml .php3 .php
Edit line to read
AddType application/x-httpd-php .phtml .php3 .php .html .htm

If needed in one or more folders: Use gopo's method, add them via .htaccess


But I need to point out the security risk associated with this method!

Any upload script should probably be updated to see the newly defined files as executables too, and treat them with the same care as .php files are given. Most to me known PHP upload systems see .html files as a kind of documents, and that may be dangerous.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users