Re: Couple of beginner questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gary wrote:
I've done a number of sites in html and am now venturing into php.

Can I create a page in html and insert php code that will work? (for example, take an existing page and insert a date command)

if it has the file extension .php then it will be passed through php and compiled; otherwise the php source code you insert will just show up in the html source.


Can I create a page with the php extension that contains only contains html and no php? If so are there advantages/disadvantages?

yep; advantage is if you later add in some php to the page it'll compile (see above)


Can I mix and match file formats (php/html) in a single site?

yep, every file is a different file


Thanks for any input.

Gary


np; you may get some comments about being able to configure you're server so that php parses files with different extensions (such as .html); but this would require some customisation of the web server config files and probably best avoided for now.

note: sometimes it is worth always having each script/html page in it's own directory with the default file name; that way you can upgrade chop and change without changing the page urls - ie:

if you make /contact/index.html or /contact/index.php
then the url /contact/ will show the default index page, allowing you to swap and change

whereas if you have /contact.html then you'll need to rename the file to contact.php and thus you're urls will change unnessacerily.

ps: wd for choosing php :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux