Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // A few basic things. Unless specified, (and that would be very rare) PHP code will only run if your page has the .php extension. You can put HTML code in here too but this way php can run.
- // You tell the server that you are wanting the PHP to be processed when you start with <?php
- // Depending on your server <? is also fine.
- ?>
- <!-- once you end the PHP code, you can put regular HTML in the document -->
- <html>
- <head>
- </head>
- <body>
- <?
- // And then you can start it again with <?
- // includes the file called navigation.html . You can include anything, including another php document.
- include('navigation.html');
- // You can also use include_once(); , require(); and require_once(); There are different times when you use these, i'd say if you want to know check the php manual cause it can be really useful.
- $aVariable = "5";
- // Coming from AS3, a difference is every statement must have a ; at the end
- ?>
- <div class="content-wrapper">
- <p>And now you can continue html code again</p>
- <!-- If you want to make a website this way, you can have all your content included in a similar way -->
- <?
- include('home-page-content.html');
- ?>
- <p> It separates content and design even more :D </p>
- </div>
- </body>
- <!-- I just put the html stuff in here as an example, its kinda really wrong when it comes to the doctype and head, heh. -->
- </html>
Advertisement
Add Comment
Please, Sign In to add comment