SlideShare une entreprise Scribd logo
1  sur  9
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

Contenu connexe

Tendances

Building complex single page application should be as enjoyable as visit to a...
Building complex single page application should be as enjoyable as visit to a...Building complex single page application should be as enjoyable as visit to a...
Building complex single page application should be as enjoyable as visit to a...
Igor Moochnick
 
MVVM Magic in SharePoint 2010 using Knockoutjs!
MVVM Magic in SharePoint 2010 using Knockoutjs!MVVM Magic in SharePoint 2010 using Knockoutjs!
MVVM Magic in SharePoint 2010 using Knockoutjs!
jhendrix88
 
Web sphere application server administration
Web sphere application server administrationWeb sphere application server administration
Web sphere application server administration
akirait4
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutions
woutervugt
 

Tendances (18)

Introduction to backbone_js
Introduction to backbone_jsIntroduction to backbone_js
Introduction to backbone_js
 
Data Visualization with D3
Data Visualization with D3Data Visualization with D3
Data Visualization with D3
 
MeteorJS Introduction
MeteorJS IntroductionMeteorJS Introduction
MeteorJS Introduction
 
Database basics
Database basicsDatabase basics
Database basics
 
Building complex single page application should be as enjoyable as visit to a...
Building complex single page application should be as enjoyable as visit to a...Building complex single page application should be as enjoyable as visit to a...
Building complex single page application should be as enjoyable as visit to a...
 
MVVM Magic in SharePoint 2010 using Knockoutjs!
MVVM Magic in SharePoint 2010 using Knockoutjs!MVVM Magic in SharePoint 2010 using Knockoutjs!
MVVM Magic in SharePoint 2010 using Knockoutjs!
 
Web sphere application server administration
Web sphere application server administrationWeb sphere application server administration
Web sphere application server administration
 
Dot Net Nuke Presentation
Dot Net Nuke PresentationDot Net Nuke Presentation
Dot Net Nuke Presentation
 
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
 
13 deploying cloud applications
13   deploying cloud applications13   deploying cloud applications
13 deploying cloud applications
 
Drupal 7 unleashed
Drupal 7 unleashedDrupal 7 unleashed
Drupal 7 unleashed
 
Weblogic OnlineTraining | Weblogic Training Online | weblogic online training
Weblogic OnlineTraining | Weblogic Training Online | weblogic online trainingWeblogic OnlineTraining | Weblogic Training Online | weblogic online training
Weblogic OnlineTraining | Weblogic Training Online | weblogic online training
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutions
 
Msbi 2012 online training
Msbi 2012 online trainingMsbi 2012 online training
Msbi 2012 online training
 
SQL Azure
SQL AzureSQL Azure
SQL Azure
 
From SQL to MongoDB
From SQL to MongoDBFrom SQL to MongoDB
From SQL to MongoDB
 
CGS2835 HTML5
CGS2835 HTML5CGS2835 HTML5
CGS2835 HTML5
 
jQuery - Web Engineering
jQuery - Web Engineering jQuery - Web Engineering
jQuery - Web Engineering
 

En vedette (9)

14a exceptions
14a exceptions14a exceptions
14a exceptions
 
Web architecture v3
Web architecture v3Web architecture v3
Web architecture v3
 
06a methods original
06a methods original06a methods original
06a methods original
 
15a gui
15a gui15a gui
15a gui
 
04 variables
04 variables04 variables
04 variables
 
07 java api and inheritance
07 java api and inheritance07 java api and inheritance
07 java api and inheritance
 
12 abstract classes
12 abstract classes12 abstract classes
12 abstract classes
 
Sdlc
SdlcSdlc
Sdlc
 
03 objects
03 objects03 objects
03 objects
 

Similaire à Mysocial

Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developersIntroduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
AoteaStudios
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
Aren Zomorodian
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVC
Sagar Kamate
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
Dilip Patel
 

Similaire à Mysocial (20)

Frameworks
FrameworksFrameworks
Frameworks
 
SQL Server 2019 Master Data Service
SQL Server 2019 Master Data ServiceSQL Server 2019 Master Data Service
SQL Server 2019 Master Data Service
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015
 
Sqlite
SqliteSqlite
Sqlite
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 
Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developersIntroduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
 
Mysocial databasequeries
Mysocial databasequeriesMysocial databasequeries
Mysocial databasequeries
 
Mysocial databasequeries
Mysocial databasequeriesMysocial databasequeries
Mysocial databasequeries
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
Creating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JSCreating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JS
 
ASP.NET Lecture 3
ASP.NET Lecture 3ASP.NET Lecture 3
ASP.NET Lecture 3
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
 
Asp.Net MVC 5 in Arabic
Asp.Net MVC 5 in ArabicAsp.Net MVC 5 in Arabic
Asp.Net MVC 5 in Arabic
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
 
Working with a super model for SharePoint Tuga IT 2016
Working with a super model for SharePoint Tuga IT 2016Working with a super model for SharePoint Tuga IT 2016
Working with a super model for SharePoint Tuga IT 2016
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVC
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
 
Sitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayoutsSitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayouts
 

Plus de Program in Interdisciplinary Computing (20)

Phpmysqlcoding
PhpmysqlcodingPhpmysqlcoding
Phpmysqlcoding
 
CGS2835 HTML5
CGS2835 HTML5CGS2835 HTML5
CGS2835 HTML5
 
01 intro tousingjava
01 intro tousingjava01 intro tousingjava
01 intro tousingjava
 
Xhtml
XhtmlXhtml
Xhtml
 
Webdev
WebdevWebdev
Webdev
 
Web architecture
Web architectureWeb architecture
Web architecture
 
Javascript
JavascriptJavascript
Javascript
 
Javascript
JavascriptJavascript
Javascript
 
Html5
Html5Html5
Html5
 
Drupal
DrupalDrupal
Drupal
 
Database
DatabaseDatabase
Database
 
Javascript2
Javascript2Javascript2
Javascript2
 
11 polymorphism
11 polymorphism11 polymorphism
11 polymorphism
 
13 interfaces
13 interfaces13 interfaces
13 interfaces
 
15b more gui
15b more gui15b more gui
15b more gui
 
14b exceptions
14b exceptions14b exceptions
14b exceptions
 
13 life and scope
13 life and scope13 life and scope
13 life and scope
 
11 interfaces
11 interfaces11 interfaces
11 interfaces
 
10 abstract
10 abstract10 abstract
10 abstract
 
09 polymorphism
09 polymorphism09 polymorphism
09 polymorphism
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

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