I'm in the design phase of a medium-sized PHP web application (not a static website). Since I'm a programmer with the creativity of an eggplant I'd like to contract with a freelancer to design the look and feel of the application. What deliverable should I ask for from the designer? HTML files? PHP files? How do I apply the look and feel from the designer to my app?
A PHP developer is responsible for writing server-side web application logic. PHP developers usually develop back-end components, connect the application with the other (often third-party) web services, and support the front-end developers by integrating their work with the application.
Primarily, PHP's future scope resides in web development. They are responsible for designing, creating, and maintaining the websites and applications for the Internet. PHP with a database can create interactive and dynamic websites and applications.
In its simplest form, PHP is a server-side scripting language that is embedded in HTML. PHP allows web developers to create dynamic content and to interact with databases. PHP is known for its simplicity, speed, and flexibility — features which have made it a cornerstone in the web development world.
Ask for:
Once it's time to integrate the deisgn into your application, you want to separate the design from your logic and database access. This makes maintenance easier later on, and also will make it easier to make changes as you develop the application.
- Although the specifics of which ones you should use are outside the scope of this answer, note that there are many frameworks and paradigms (MVC frameworks, content management systems, etc) which facilitate the separation of the logic.
A simple way to separate the logic from the design is to simply set up variables in PHP files, and then include the appropriate files for the design (which should also be php, or phtml files as you'll see below). Also, you should take any sections of the page that recur in many pages and have those as a separate php file which you can include in other pages. For example...
Bad Way (do NOT do this!):
//File: itemsPage.php:
<html>
<head>
<title>Our items</title>
</head>
<body>
<?php
echo "<ol>";
$itemsResult = mysql_query("SELECT * FROM items ORDER BY id LIMIT 10");
while ($item=mysql_fetch_array($itemsResult)){
echo "<li>".$item['name']." - ".$item['description']."</li>";
}
echo "</ol>";
?>
<br><br>
Affiliates: Microsoft | Bob's Home Furnishing Store | <a href="http://www.example.com/affiliates.php">become an affiliate</a>
</body>
</html>
Better Way:
//File: itemsPage.php
<?php
$title='Our Items';
include('header.php');
include('items.php');
include('footer.php');
?>
...
//File: header.php
<html>
<head>
<title><?php echo $title?></title>
</head>
<body>
...
//File: items.php
<?php
$itemsResult = mysql_query("SELECT * FROM items ORDER BY id LIMIT 10");
$items=array();
while ($item=mysql_fetch_array($itemsResult))
$items[]=$item;
include('items.phtml');
?>
...
//File: items.phtml
<ol>
<?php foreach ($items as $item){?>
<li><?php echo $item['name']?> - <?php echo $item['description']?></li>
<? } ?>
</ol>
...
//File: footer.php
<br><br>
Affiliates: Microsoft | Bob's Home Furnishing Store | <a href="http://www.example.com/affiliates.php">become an affiliate</a>
</body>
</html>
Best way: As hinted at above, the best way to go about this is to use a framework (Zend, etc), which will be designed to make things as organized and easy as possible for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With