LESSON 1&2- WEB SYSTEMS AND TECHNOLOGIES AND PHP BASICS.pdf

Document Details

RealizableZinc

Uploaded by RealizableZinc

Don Honorio Ventura State University

Tags

web development PHP internet technologies programming

Full Transcript

WEB SYSTEMS AND TECHNOLOGIES Prepared By: Andrei M. Viscayno IT ELEC 2 - LESSON 1 WHAT IS WEB SYSTEMS? Web Systems and Technologies refers to the collection of tools, frameworks, protocols, and methodologies used to create, deploy, and manage web-based applica...

WEB SYSTEMS AND TECHNOLOGIES Prepared By: Andrei M. Viscayno IT ELEC 2 - LESSON 1 WHAT IS WEB SYSTEMS? Web Systems and Technologies refers to the collection of tools, frameworks, protocols, and methodologies used to create, deploy, and manage web-based applications and services. It encompasses various aspects of web development, from the front-end interfaces users interact with to the back-end systems that power these applications. Here's a sample of Web Systems: 1. Front-End Development: Technologies: HTML, CSS, JavaScript, and frameworks like React, Angular, and Vue.js. Purpose: Creating the user interface (UI) and ensuring a good user experience (UX) by making web pages responsive, accessible, and interactive. 2. Back-End Development: Technologies: Server-side languages like Python (Django, Flask), PHP (Laravel), Ruby (Rails), Java (Spring), and Node.js (Express). Purpose: Handling business logic, database interactions, and server-side operations. This includes APIs, authentication, data processing, and more. WHAT IS WEB SYSTEMS? 3. Databases: Technologies: SQL databases (MySQL, PostgreSQL) and NoSQL databases (MongoDB, Redis). Purpose: Storing and managing data for web applications. 4. Web Servers: Technologies: Apache, Nginx, IIS. Purpose: Serving web pages to users by processing incoming requests and delivering the appropriate content. 5. Web Protocols: Protocols: HTTP/HTTPS, FTP, REST, SOAP, WebSockets. Purpose: Governing how data is transmitted over the web, enabling communication between clients (browsers) and servers. 6. Content Management Systems (CMS): Examples: WordPress, Joomla, Drupal. Purpose: Allowing users to manage and publish digital content without needing deep technical knowledge. WHAT IS WEB SYSTEMS? 7. Web Hosting and Cloud Services: Providers: AWS, Google Cloud, Microsoft Azure. Purpose: Hosting websites and web applications, often providing scalable resources to handle varying traffic loads. 8. Security: Technologies: SSL/TLS, OAuth, encryption algorithms, firewalls. Purpose: Protecting web applications from threats like hacking, data breaches, and ensuring secure transactions. 9. DevOps and Continuous Integration/Continuous Deployment (CI/CD): Tools: Jenkins, Docker, Kubernetes, Git. Purpose: Streamlining the development, testing, and deployment processes to improve efficiency and reduce errors. 10. Web Analytics and SEO: Tools: Google Analytics, SEMrush, Moz. Purpose: Monitoring web traffic, user behavior, and optimizing content for search engines to improve visibility. WEB APPLICATIONS A Web Application is a software program that runs on a web server and is accessed through a web browser over the internet. Unlike traditional desktop applications, which are installed on a personal computer, web applications are hosted on remote servers and delivered to users through the web. Here’s a popular sample of web applications: 1. E-Commerce Platforms 2. Social Media Platforms 3. Content Management Systems (CMS) 4. Web-Based Email Clients 5. Streaming Services 6. Collaboration and Productivity Tools 7. Online Learning Platforms 8. Cloud Storage Services 9. Financial and Banking Applications 10. Entertainment and Media Platforms CURRENT TRENDS AND TECHNOLOGIES IN WEB Progressive Web Apps (PWA): Combining the best of web and mobile apps. Single Page Applications (SPA): Seamless user experience using frameworks like Angular, React. Serverless Architecture: AWS Lambda, Azure Functions. WebAssembly (Wasm): High-performance applications on the web. AI and Machine Learning Integration: Enhancing user experience and personalization. Voice Search Optimization: Adapting websites for voice-based queries. Cybersecurity Measures: Increasing focus on protecting web applications from threats. PHP BASICS Prepared By: Andrei M. Viscayno IT ELEC 2 - LESSON 2 WHAT IS PHP? PHP (Hypertext Preprocessor) is a widely-used, open-source server-side scripting language that is especially suited for web development. It was originally created by Rasmus Lerdorf in 1994 and has since become one of the most popular languages for creating dynamic and interactive websites. Key Features of PHP: Server-Side Scripting Embedded in HTML Cross-Platform Compatibility Database Integration Extensive Library and Framework Support Open Source HOW PHP WORKS? 1. Web Browser (Client-Side) Request: A user interacts with a web page and their browser sends a request to the web server to load the page. This request could be for a PHP file, which contains PHP code. 2. Web Server Processing: The web server receives the request and identifies that it needs to process a PHP file. The server passes the PHP file to the PHP engine, which is responsible for executing the PHP code within the file. HOW PHP WORKS? 3. PHP Code Execution: The PHP engine processes the PHP code. During this process, the PHP code can interact with a database, like MySQL, to retrieve or store information. After processing, the PHP code generates an HTML file as the output. 4. Response Back to Web Browser: The web server sends the generated HTML file back to the user's web browser as a response. The browser then displays the content of the HTML file to the user, which could be a fully rendered web page. PHP INSTALLATIONS Installing PHP depends on the operating system you're using and the web server you plan to work with. Visit this link (https://www.youtube.com/watch?v=G2VEf-8nepc) for basic guide for installing PHP on different platforms. Windows: Using XAMPP XAMPP is a popular package that includes PHP, Apache (a web server), and MySQL (a database). PHP SYNTAX PHP syntax refers to the set of rules that define how PHP code is written and structured. Understanding PHP syntax is essential for writing and executing PHP scripts correctly. A PHP script is executed on the server, and the plain HTML result is sent back to the browser. A PHP script can be placed anywhere in the document. The default file extension for PHP files is ".php". PHP code is usually embedded within HTML and is enclosed within special PHP tags : These are the opening and closing tags for PHP. Everything between these tags is treated as PHP code and will be executed by the server. Each PHP statement ends with a semicolon (;). PHP is case-sensitive for variables ($name and $Name are different), but function names are not case-sensitive. PHP SYNTAX INSIDE HTML PHP ITSELF PHP VARIABLE A PHP variable is a container used to store data that can be used and manipulated throughout a PHP script. Variables in PHP are dynamic, meaning they can hold different types of data, such as strings, numbers, arrays, and more. They are essential for making PHP scripts dynamic and interactive. Rules for PHP variables: A variable starts with the $ sign, followed by the name of the variable A variable name must start with a letter or the underscore character A variable name cannot start with a number A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _) Variable names are case-sensitive ($age and $AGE are two different variables) PHP VARIABLE Key Characteristics of PHP Variables: 1. Prefix with a Dollar Sign ($): Every variable in PHP begins with a $ symbol. 2. Case-Sensitive: Variable names are case-sensitive, meaning $age, $Age, and $AGE are treated as three different variables. PHP VARIABLE Key Characteristics of PHP Variables: 3. No Need to Declare Data Type: PHP is a loosely typed language, so you don't need to declare the type of the variable (like int or string). The type is determined by the value assigned to the variable. 4. Naming Rules: Variable names must start with a letter or an underscore (_). They can contain letters, numbers, and underscores, but they cannot contain spaces or special characters. PHP ECHO The echo statement in PHP is used to output data to the screen, typically within a web page. It is one of the most common and simplest ways to display content such as text, variables, and HTML code. Key Points About echo: 1. Basic Usage: The echo statement is used to display text or variables. It can be used with or without parentheses. PHP ECHO 2. Output Strings: You can directly output strings using echo. 3. Output Variables: echo can be used to display the value of a variable. PHP ECHO 4. Concatenation: You can concatenate (join) multiple strings and variables together using the. operator. 5. Output HTML: echo can also be used to output HTML code, which will be rendered by the browser. PHP ECHO 6. Multiple Parameters: echo can accept multiple parameters, separated by commas, although this is less commonly used. 7. Performance: echo is slightly faster than print because it doesn't return a value. While print always returns 1, echo simply outputs the content and continues with the script. PHP DATATYPES In PHP, data types refer to the different kinds of values that variables can hold. Understanding PHP data types is crucial because it allows you to manage and manipulate data effectively in your code. PHP supports several data types, which can be broadly categorized into scalar types, compound types, and special types. Scalar Data Types: Scalar data types are the simplest types of data, representing a single value. 1. String: A sequence of characters enclosed in single (') or double (") quotes. PHP DATATYPES 2. Integer: A non-decimal number, either positive or negative. 3. Float (or Double): A number with a decimal point or in exponential form. PHP DATATYPES 4. Boolean: Represents a value of either true or false. Compound Data Types: Compound data types can hold multiple values. 1. Array: An array is a collection of values. Each value in the array can be of any data type, and it is accessed using an index or key. PHP DATATYPES 2. Object: An object is an instance of a class. It allows you to create complex data structures that model real- world entities. PHP DATATYPES Special Data Types: These data types handle special cases. 1. NULL: The NULL data type represents a variable with no value. It is the only possible value of the type NULL. 2.Resource: A special type that holds a reference to an external resource, such as a database connection or file handler. PHP SUPERGLOBALS PHP superglobals are built-in global arrays that are always accessible, regardless of scope. They are automatically available in all scopes (no need to use global to access them). Superglobals are very useful because they allow you to retrieve or pass data in your PHP applications. Common PHP Superglobals: 1. $_GET Contains data sent to the script via URL parameters (query strings). Example: If the URL is example.com/page.php?name=John&age=25, you can access these values using: PHP SUPERGLOBALS 2. $_POST Contains data sent to the script via an HTML form using the POST method. 3. $_REQUEST Contains data sent to the script via both $_GET, $_POST, and $_COOKIE. It combines the data from these three superglobals, allowing you to access them all in one place. PHP SUPERGLOBALS 4. $_FILES Contains information about files uploaded to the script via an HTML form using the POST method with enctype="multipart/form-data". 5. $_COOKIE Contains data sent to the script via HTTP cookies. Cookies are small pieces of data stored on the client-side and sent to the server with every request. PHP SUPERGLOBALS 6. $_SESSION Contains data related to a user session. Sessions are used to store information across multiple pages or page requests. 7. $_SERVER Contains information about the server environment and the client request. It includes data such as headers, paths, and script locations. PHP SUPERGLOBALS 8. $_ENV Contains data related to the environment in which the script is running. Environment variables are often set outside of PHP, in the server configuration or OS. 7. $_GLOBALS Contains all global variables in the script. It allows you to access global variables from any scope, including within functions and classes. THANK YOU WEB SYSTEMS AND TECHNOLOGIES IT ELEC 2 - LESSON 1 Prepared By: Andrei M. Viscayno

Use Quizgecko on...
Browser
Browser