SlideShare a Scribd company logo
Integration: MySocial
      Introduction
Interdisciplinary Web Development
              CGS2835
Model-View-Controller
• Model: Code to process, retrieve, and store data on a server (PHP,
   MySQL)
• View: Renders the Model into a website (XHTML, CSS)
• Controller: Processes user input (JavaScript, PHP, XHTML)




                              CGS2835 WebDev
Model-View-Controller

User input (click a link, submit a form)

                                                PHP/JavaScript
                                                                      Adds/Removes data from the Database

                              Shows a webpage


                                    Updates information to the webpage


              What you see                                                          Database
                                    Requests Data from the database




                                           http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

                                                CGS2835 WebDev
Model
• MySQL Database
  – Tables and Fields to store data
• What kind of information would you need to
  store for a social net?




                       CGS2835 WebDev
Model
• TABLE: users
  – userID, username, password, picture
• TABLE: posts
  – userID, post, time
• TABLE: friends
  – user, friend




                         CGS2835 WebDev
Model
• database_queries.php
  – MySQL queries to put and get data
  – Handles all database access
• connect.php
  – Connection functions in one place
• security.php
  – Functions for sanitization of input
  – Functions for password hashing
  – Functions for user authentication
                       CGS2835 WebDev
View
• What things do all pages need to see?
• top.php
  – The top navigation bar of all pages
  – Specifies the style sheet to be used “style.css”
  – Included on all view pages with
     • <?php include(“top.php”); ?>




                        CGS2835 WebDev
View
• index.php: Main page
• user.php?userID=
  – Choosing a user profile to show using $_GET
  – $_GET is like $_POST except it gets information after
    the ? in the address instead of a form that posts
    information
  – Shows a user’s page, their posts and information
  – Shows a form to make a post on a user page
• user_form.php
  – Shows the forms for making a new user and logging in

                        CGS2835 WebDev
Controller
• Handles $_POST from forms and sends the
  data to database_queries.php functions
• newuser_process.php
  – Processes the new user form
• user_process.php
  – Processes the user login form
• post_process.php
  – Processes the user post form

                      CGS2835 WebDev

More Related Content

PPTX
Implemeting Sencha Ext JS in Drupal
PDF
Tech talk live share extras extension modules feb 13
PPTX
Let's Get Small: A Microservices Approach to Library Websites
PPT
Php connectivitywithmysql
PPTX
Liquibase via maven
PPTX
poster_michaelGerhart
ODP
BackboneJS and friends
PDF
Tech talk-live-alfresco-drupal
Implemeting Sencha Ext JS in Drupal
Tech talk live share extras extension modules feb 13
Let's Get Small: A Microservices Approach to Library Websites
Php connectivitywithmysql
Liquibase via maven
poster_michaelGerhart
BackboneJS and friends
Tech talk-live-alfresco-drupal

What's hot (18)

PPSX
Introduction to backbone_js
PPTX
Data Visualization with D3
PDF
MeteorJS Introduction
PPTX
Building complex single page application should be as enjoyable as visit to a...
PPTX
MVVM Magic in SharePoint 2010 using Knockoutjs!
PDF
Web sphere application server administration
PPT
Dot Net Nuke Presentation
PPTX
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
PPTX
13 deploying cloud applications
PPT
Drupal 7 unleashed
PDF
Weblogic OnlineTraining | Weblogic Training Online | weblogic online training
PPTX
Hdv309 - Real World Sandboxed Solutions
PPTX
Msbi 2012 online training
PPTX
SQL Azure
PDF
From SQL to MongoDB
PPTX
jQuery - Web Engineering
Introduction to backbone_js
Data Visualization with D3
MeteorJS Introduction
Building complex single page application should be as enjoyable as visit to a...
MVVM Magic in SharePoint 2010 using Knockoutjs!
Web sphere application server administration
Dot Net Nuke Presentation
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
13 deploying cloud applications
Drupal 7 unleashed
Weblogic OnlineTraining | Weblogic Training Online | weblogic online training
Hdv309 - Real World Sandboxed Solutions
Msbi 2012 online training
SQL Azure
From SQL to MongoDB
jQuery - Web Engineering
Ad
Ad

Similar to Mysocial (20)

PPTX
SQL Server 2019 Master Data Service
PPTX
Building Modern Websites with ASP.NET by Rachel Appel
PPTX
ASP.NET MVC 5 - EF 6 - VS2015
PPT
Sqlite
PDF
Asp.net mvc basic introduction
PDF
Introduction to Backbone.js for Rails developers
PPT
Mysocial databasequeries
PPT
Mysocial databasequeries
PDF
Access Data from XPages with the Relational Controls
PPTX
Getting started with MVC 5 and Visual Studio 2013
PPTX
Creating Single Page Web App using Backbone JS
PPTX
ASP.NET Lecture 3
PPTX
Web Technologies - forms and actions
PPTX
Contains the SQLite database management classes that an application would use...
PPTX
Asp.Net MVC 5 in Arabic
PDF
Nuxt.JS Introdruction
PPTX
Working with a super model for SharePoint Tuga IT 2016
PPTX
Introduction to ASP.Net MVC
PPTX
MVC & SQL_In_1_Hour
SQL Server 2019 Master Data Service
Building Modern Websites with ASP.NET by Rachel Appel
ASP.NET MVC 5 - EF 6 - VS2015
Sqlite
Asp.net mvc basic introduction
Introduction to Backbone.js for Rails developers
Mysocial databasequeries
Mysocial databasequeries
Access Data from XPages with the Relational Controls
Getting started with MVC 5 and Visual Studio 2013
Creating Single Page Web App using Backbone JS
ASP.NET Lecture 3
Web Technologies - forms and actions
Contains the SQLite database management classes that an application would use...
Asp.Net MVC 5 in Arabic
Nuxt.JS Introdruction
Working with a super model for SharePoint Tuga IT 2016
Introduction to ASP.Net MVC
MVC & SQL_In_1_Hour

More from Program in Interdisciplinary Computing (20)

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Electronic commerce courselecture one. Pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Approach and Philosophy of On baking technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.
Per capita expenditure prediction using model stacking based on satellite ima...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
NewMind AI Weekly Chronicles - August'25 Week I
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Electronic commerce courselecture one. Pdf
Review of recent advances in non-invasive hemoglobin estimation
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Approach and Philosophy of On baking technology
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Dropbox Q2 2025 Financial Results & Investor Presentation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf

Mysocial

  • 1. Integration: MySocial Introduction Interdisciplinary Web Development CGS2835
  • 2. Model-View-Controller • Model: Code to process, retrieve, and store data on a server (PHP, MySQL) • View: Renders the Model into a website (XHTML, CSS) • Controller: Processes user input (JavaScript, PHP, XHTML) CGS2835 WebDev
  • 3. Model-View-Controller User input (click a link, submit a form) PHP/JavaScript Adds/Removes data from the Database Shows a webpage Updates information to the webpage What you see Database Requests Data from the database http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller CGS2835 WebDev
  • 4. Model • MySQL Database – Tables and Fields to store data • What kind of information would you need to store for a social net? CGS2835 WebDev
  • 5. Model • TABLE: users – userID, username, password, picture • TABLE: posts – userID, post, time • TABLE: friends – user, friend CGS2835 WebDev
  • 6. Model • database_queries.php – MySQL queries to put and get data – Handles all database access • connect.php – Connection functions in one place • security.php – Functions for sanitization of input – Functions for password hashing – Functions for user authentication CGS2835 WebDev
  • 7. View • What things do all pages need to see? • top.php – The top navigation bar of all pages – Specifies the style sheet to be used “style.css” – Included on all view pages with • <?php include(“top.php”); ?> CGS2835 WebDev
  • 8. View • index.php: Main page • user.php?userID= – Choosing a user profile to show using $_GET – $_GET is like $_POST except it gets information after the ? in the address instead of a form that posts information – Shows a user’s page, their posts and information – Shows a form to make a post on a user page • user_form.php – Shows the forms for making a new user and logging in CGS2835 WebDev
  • 9. Controller • Handles $_POST from forms and sends the data to database_queries.php functions • newuser_process.php – Processes the new user form • user_process.php – Processes the user login form • post_process.php – Processes the user post form CGS2835 WebDev