Page 1 of 1

PHP & HTML

Posted: Sun Jun 27, 2010 9:02 pm
by qbberryjr
Can i use html elements in a .PHP document? if so, do the rules change?

Re: PHP & HTML

Posted: Sun Jun 27, 2010 10:43 pm
by requinix
Yes and no.

But I have no idea what you're talking about.

Re: PHP & HTML

Posted: Mon Jun 28, 2010 3:47 am
by qbberryjr
okay, i want to create a php document in dreamweaver 8. can i start off my html code in a php document the same way i would if i was using a html document?


this is what i have so far. this is a php document and i added elements the same way i would in a html document. i have not put php scripts in yet but would there be a problem doing so?

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title></title>
<link href="untitled.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {font-family: Impact}
.style3 {font-family: "You Are Loved"}
.teez_links_T_Blue {color: #04187d}
-->
</style>
</head>

<body>
<div id="container">
  <div id="links">
    <div align="center"><span class="style3"><span class="teez_links_T_Blue">T</span>eez<span class="teez_links_T_Blue">T</span>oo.Com</span> &nbsp; &nbsp; &nbsp; &nbsp;<span class="style1 style2">Home | Previous Weeks | Contact | Associates</span> </div>
  </div>
  <div id="bigbanner"><img src="" alt="" name="bigbanner" width="800" height="333" id="bigbanner" style="background-color: #999999" /></div>
</div>
</body>
</html>

Re: PHP & HTML

Posted: Mon Jun 28, 2010 4:38 am
by requinix
There are only two(ish) requirements:
- The file has a .php extension
- PHP code and only PHP code comes between a "<?php" opening tag and a "?>" closing tag

Beyond that you're (almost) free to do whatever you want.

Re: PHP & HTML

Posted: Mon Jun 28, 2010 6:02 am
by qbberryjr
Thanks! Just wanted to make sure. I'm learning php on my own and not through school so I just wanted to make sure.