Cards (45)

  • Mobile-First Web Applications
    Websites that are designed and optimized for mobile devices first, before being adapted for larger screens
  • Why should your website be mobile-first?
    • Mobile-first websites have a lower bounce rate and a higher percentage of visits
    • Such platforms are ranked higher by search engines
    • You gain users' loyalty (customer satisfaction)
    • Attractive mobile-first design attracts more visitors
    • Web pages load faster and website performance improves
  • Google has announced mobile-first indexing
  • How to make a mobile-first website?
    • Use a responsive framework
    • Improve user experience
    • Implement techniques to increase page loading speed
    • Improve website navigation
  • Modern Frontend Responsive Frameworks
    • Bootstrap
    • Foundation
    • Skeleton
    • HTML5 Boilerplate
    • Montage
    • SproutCore
    • Zebra
    • CreateJS
    • Less Framework
  • XAMPP
    Open source, easy to install and use, PHP development environment developed by Apache Friends
  • XAMPP stands for: X - Cross Platform (Windows/Mac/Linux), A - Apache server, M - MariaDB (fully open source version of MySQL), P - PHP engine built in, P - Perl (we won't be using this)
  • Dynamic Websites
    Websites with "dynamic" content which are generated by client-side and server-side scripting
  • Dynamic web pages are generated on the fly with content sourced from database/web services/server file system
  • Client-Side Processing
    The part of a website that the user interacts with directly, usually written in JavaScript to reduce server load and provide instant feedback
  • Server-Side Processing
    The back end or server-side of a website that stores and arranges data, and makes sure everything on the client-side works fine
  • Server-side processing involves code processed by the HTTP (Web) server to generate a customised web page for each client request
  • Our technologies
    • Client-side: HTML, CSS, JavaScript
    • Server-side: PHP
  • HTML is the standard markup language for web pages
  • CSS is used to control the styling and layout of web pages
  • PHP is a widely-used server-side scripting language that can also be used for client-side
  • PHP code is executed on the server, and the result is returned to the browser as plain HTML/CSS/JS
  • PHP can be used to access files and databases on the server, provide dynamic pages, process form information, control user-access, encrypt data, and output HTML/images/PDFs/etc.
  • PHP is open source, runs on various platforms, supports many databases, and has a large library of built-in functions and common extensions
  • PHP
    Server-side scripting language
  • PHP
    • Runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
    • PHP scripts are executed on the server
    • Supports many databases (MySQL, Oracle, Sybase, PostgreSQL, Generic ODBC, etc.)
    • Open source software
    • Large library of in-built functions and common extensions
    • Available on LJMU servers and most commercial web hosts
  • PHP is a popular language in industry; useful to know for future placements/jobs
  • Approximately 83.1% of sites use PHP as their server-side language
  • A PHP Web Request
    1. Browser requests a .htm/html file (static content): server just sends that file
    2. Browser requests a .php file (dynamic content): server reads it, runs php script inside it, then sends html result back
  • PHP script
    Starts with <?php and ends with ?>
  • PHP type system

    • String
    • Integer
    • Float (floating point numbers - also called double)
    • Boolean
    • Array
    • Object
    • NULL
    • Resource
  • PHP Variables
    Used for storing values, like text strings, numbers or arrays<|>Variables are case-sensitive<|>Do not need to be declared before adding a value to them<|>Do not need to specify a data type
  • Global variables
    To use global variable inside function, use keyword 'global'
  • PHP Concatenation
    The concatenation operator (.) is used to put two string values together
  • PHP Operators
    • Arithmetic
    • Assignment
    • Comparison
    • Increment/Decrement
    • Logical
    • String
  • PHP Conditional Statements
    • if statement
    • if...else statement
    • if...elseif....else statement
    • switch statement
  • if statement

    • Use this statement to execute some code only if a specified condition is true
  • if...else statement

    • Use this statement to execute some code if a condition is true and another code if the condition is false
  • if...elseif....else statement
    • Use this statement to select one of several blocks of code to be executed
  • switch statement

    • Use this statement to select one of many blocks of code to be executed
  • PHP Loops
    • while
    • do...while
    • for
    • foreach
  • PHP Functions
    A function is a block of statements that can be used repeatedly in a program<|>A function will not execute automatically when a page loads<|>A function will be executed by a call to the function
  • User-defined Functions
    • Give the function a name that reflects what the function does
    • Avoid names that are already part of the PHP Library
    • The function name can start with a letter or underscore (not a number)
    • Functions are defined in blocks that are delineated with curly braces {}
  • Useful PHP commands
    gettype(), unset(), isset(), empty(), var_dump(), is_null(), is_bool(), is_string(), is_numeric(), is_callable()
  • PHP Arrays
    • Array Creation or Initialization
    • Size of Array
    • Adding and Modifying Elements