Sunday, March 27, 2016

Using PHP for Web Design

Using PHP to code & validate web forms
This spring I enrolled in a web design course with UVM.  Weekly we have been creating with Code!  To date, I've created four different web sites using HTML and CSS.  In addition, we have been writing a lot of PHP to create the HTML code on each page, or for validating forms, debugging and automating pages.

For example, instead of updating a footer element on each page of a ten page site - just create a footer.php page and write your footer.  Then, call the footer on each web page using a PHP include statement.  Very cool way to do mass updates and changes.  I learned that the same process can be used to create a header.php, nav.php and top.php pages.  This process ensures that each page is structured the same way.

CSS stands for Cascading Style Sheets.  CSS is what makes webpages look great - color, fonts, design and layout.  A fun website to see how CSS works is to explore csszengarden.com.  On this site, all of the content is the same, but the CSS gives each example a unique look.  CSS is very powerful and a creative way to style the web and improve the user experience.

This past week, we've been using PHP to validate our forms, sanitize and check our data for errors and return a confirmation statement or error - with an array to list those errors.
Check out the error functionality I created using PHP code:
https://wbohmann.w3.uvm.edu/cs008/assignment3.1/form.php

The PHP coding for form validation took over 10 hours to write and included more than 300 lines of code.  This has been a challenging class with UVM - mostly due to the PHP.  However, I've been learning a lot about creating more functional websites.  For my final project, I plan to create a website for my summer food truck - StreetGreens.

No comments:

Post a Comment