Re: Couple of beginner questions

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

 



Hey Gary,

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)

--- Of course you can do that. But it is not advised. Becoming better in PHP
in few months you will understand that its almost necessary to separate
business logic from presentation logic. But as a beginner you can do that.
So basically have <?php ?> tags around the php code that you write. better
to rename your files to .php extension.

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

-- Yes you can do that but if you have <?php  ?> it better to wrap your html
in quotes and also escape them and print it on the screen using echo command
or print command. echo is better though. or else if you dont want to open
<?php ?> tags then you can have plain html without any hassle.

-- Remember as you re still a beginner try to avoid using ?> at the end of
complete PHP code page. or else if you have empty lines at the end of the
file "then you wont see blank page of death in PHP".

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

-- Every wesbite in this world not only in PHP or anywhere is a combination
of html (presenation layer) and PHP (Logic). So the asnwer is yes.

Thanks,
V

[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