SlideShare a Scribd company logo
1 of 82
Chapter 1 Site management  & Sending & Receiving data between pages.
Dynamic web page decisions ,[object Object],[object Object],[object Object]
How PHP Pages are Accessed and Interpreted We will use WAMPS (Windows, apache, mysql, php server) and it will be locally installed on the lab machines.
WAMPS ,[object Object],[object Object],[object Object],[object Object],[object Object]
Creating a PHP Script File and Saving It to a Local Disk ,[object Object],[object Object],[object Object]
Alternative PHP Delimiters ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Little About PHP's Syntax ,[object Object],[object Object],[object Object],[object Object],[object Object]
Embedding PHP Statements Within HTML Documents ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using Backslash ( to Generate HTML Tags with print() ,[object Object],[object Object],[object Object],[object Object]
Using Comments with PHP cripts ,[object Object],[object Object],[object Object],[object Object],[object Object]
Using Comments with  PHP Scripts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example Script with Comments ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Alternative Comment Syntax ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using PHP Variables ,[object Object],[object Object]
Assigning New Values to  Variables ,[object Object],[object Object],[object Object],[object Object],[object Object]
Selecting Variable Names ,[object Object],[object Object],[object Object],[object Object]
Combining Variables and the  print  Statement ,[object Object],[object Object],[object Object],[object Object],[object Object]
A Full Example ... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using Arithmetic Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Common PHP Numeric Operators
A Full Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WARNING: Using Variables with Undefined Values If you accidentally use a variable that does not have a value assigned to it will have no value (called a null value).When a variable with a null value is used in an expression PHP, PHP may  not  generate an error and may complete the expression evaluation. For example, the following PHP script will output x= y=4. <?php $y = 3; $y=$y + $x + 1; // $x has a null value print (&quot;x=$x y=$y&quot;); ?>
Writing Complex Expressions ,[object Object],[object Object],[object Object],[object Object]
PHP Precedence Rules ,[object Object],[object Object],[object Object],[object Object]
PHP Precedence Rules ,[object Object],[object Object],[object Object],[object Object]
A Full Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Working with PHP String Variables ,[object Object],[object Object],[object Object],[object Object],[object Object]
WARNING: Be Careful Not to  Mix Variable Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using the Concatenate Operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
TIP;  An Easier Way to Concatenate Strings ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The strlen() Function ,[object Object],[object Object],[object Object]
The strlen() Function Example ,[object Object],[object Object],[object Object],[object Object],[object Object],This PHP script would output “Length=8”.
The trim() Function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The strtolower() and  strtoupper() Functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The substr() Function ,[object Object]
The substr() Function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The substr() Function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Servers and files ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dynamic Web pages requirements ,[object Object],[object Object],[object Object],[object Object]
Creating a local site Local folder is your H or F drive etc.
Creating a remote site Note:  You will have to create this folders, newlandStart. This can be done using the browse button. wampwwis the default directory.
Creating a Testing Server
Transferring to the Remote server ,[object Object],[object Object]
Changing htm to php ,[object Object],[object Object],[object Object],[object Object]
Check the pages ,[object Object],[object Object],[object Object]
Using forms to send data. ,[object Object],[object Object],[object Object],[object Object]
Retrieving data ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Creating HTML Input Forms ,[object Object],Text Box Radio Buttons Check Box Select Box Text Area Submit/Reset button
Starting And Ending HTML Forms ,[object Object]
Creating Form Buttons ,[object Object],[object Object]
Another Full Script Example 1.<html> 2.<head> <title> A Simple Form </title> </head> 3.<body> 4.<form action=&quot;http://webwizard.aw.com/~phppgm/First.php&quot; method=&quot;post&quot; > 5. Click submit to start our initial PHP program. 6. <br> <input type=&quot;submit&quot; value=&quot;Click To Submit&quot;> 7. <input type=&quot;reset&quot; value=&quot;Erase and Restart&quot;> 8. </form> 9. </body> </html>
Receiving Form Input into PHP Scripts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Full Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Register_Globals? ,[object Object],[object Object],[object Object]
How can you tell if Register_Globals is OFF? ,[object Object],[object Object],[object Object],[object Object]
Getting input data with Register_Globals OFF? ,[object Object],[object Object],Enclose in square bracket and then quotes Name of HTML form  variable (note do not use $) Special PHP Global variable. Technically it is an  associative array  (covered in chptr 5.)  PHP variable name that you want to receive the HTML form input.
Full Example, when REGISTER_GLOBALS is OFF. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Forms sending & retrieving 1 ,[object Object],[object Object],[object Object],[object Object]
Forms sending & retrieving 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Forms sending & retrieving 3 ,[object Object],[object Object],[object Object]
Forms sending & retrieving 4 ,[object Object],[object Object],[object Object],In this case the data is coming from test_form.php
Forms sending & retrieving 5 ,[object Object],[object Object],[object Object],[object Object]
Forms sending & retrieving 6 ,[object Object],[object Object],Note: You will need to put a non breaking space (&nbsp;) between the two form bindings
Looking at the code. ,[object Object],[object Object],[object Object],[object Object]
Retrieving data via URL 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Retrieving data via URL 2 Select the URL Variable and the screen below will appear. Put the name of the variable from the page calling this one, as shown; firstName The new binding as shown will appear. Drag it to where the variable should be shown. The next slide shows this.
Looking at the code ,[object Object]
Sending data with Hyperlinks. ,[object Object],[object Object],[object Object],[object Object]
Sending data with Hyperlinks 2. ,[object Object],[object Object],[object Object]
Sending data with Hyperlinks 3 ,[object Object],[object Object]
Sending data with Hyperlinks 4 ,[object Object],[object Object],[object Object]
Sending data with Hyperlinks 5 ,[object Object]
Sending data with Hyperlinks 6 ,[object Object],[object Object]
Cookies - 1 ,[object Object],[object Object],[object Object]
Cookies - 2 ,[object Object],[object Object],[object Object],[object Object]
Cookies - 3 ,[object Object],[object Object],[object Object],This code must be place before the html tag Cookie variable name
Cookies - 4 ,[object Object],[object Object]
Lab 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Lab 1 cont-2 ,[object Object],[object Object],[object Object]
unit2sendingpage.php When you click on the “Display Home “ Button the next page appears showing the  city that was typed in on this page. If you click on the link “Click Here” then it takes you to the “unit2urlactionpage.php”. The link passes your name in the URL.
unit2formactionpage.php Notice, the word “Frankston” has appeared. This was a form variable from the previous page.
unit2urlactionpage.php?firstname=Larry Notice “Larry” was sent in the URL and it is displayed  on this page. Put your name there instead.

More Related Content

What's hot

Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operators
mussawir20
 
Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)
Arjun Shanka
 
Php(report)
Php(report)Php(report)
Php(report)
Yhannah
 
Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
mussawir20
 
Php Loop
Php LoopPhp Loop
Php Loop
lotlot
 

What's hot (17)

Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operators
 
PHP MySQL Workshop - facehook
PHP MySQL Workshop - facehookPHP MySQL Workshop - facehook
PHP MySQL Workshop - facehook
 
PHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERSPHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERS
 
PHP - Introduction to PHP - Mazenet Solution
PHP - Introduction to PHP - Mazenet SolutionPHP - Introduction to PHP - Mazenet Solution
PHP - Introduction to PHP - Mazenet Solution
 
Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)
 
Open Source Package PHP & MySQL
Open Source Package PHP & MySQLOpen Source Package PHP & MySQL
Open Source Package PHP & MySQL
 
Php(report)
Php(report)Php(report)
Php(report)
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Php intro
Php introPhp intro
Php intro
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
 
Component and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHPComponent and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHP
 
Php
PhpPhp
Php
 
Php Rss
Php RssPhp Rss
Php Rss
 
Php Loop
Php LoopPhp Loop
Php Loop
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5
 

Similar to Dynamic Web Pages Ch 1 V1.0

PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
Nikhil Jain
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
webhostingguy
 

Similar to Dynamic Web Pages Ch 1 V1.0 (20)

Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
 
PHP MySQL
PHP MySQLPHP MySQL
PHP MySQL
 
What Is Php
What Is PhpWhat Is Php
What Is Php
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
Babitha5.php
Babitha5.phpBabitha5.php
Babitha5.php
 
Babitha5.php
Babitha5.phpBabitha5.php
Babitha5.php
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 

More from Cathie101

Page Layout 2010
Page Layout 2010Page Layout 2010
Page Layout 2010
Cathie101
 
Dynamic Web Pages Ch 8 V1.0
Dynamic Web Pages Ch 8 V1.0Dynamic Web Pages Ch 8 V1.0
Dynamic Web Pages Ch 8 V1.0
Cathie101
 
Dynamic Web Pages Ch 6 V1.0
Dynamic Web Pages Ch 6 V1.0Dynamic Web Pages Ch 6 V1.0
Dynamic Web Pages Ch 6 V1.0
Cathie101
 
Dynamic Web Pages Ch 9 V1.0
Dynamic Web Pages Ch 9 V1.0Dynamic Web Pages Ch 9 V1.0
Dynamic Web Pages Ch 9 V1.0
Cathie101
 
Dynamic Web Pages Ch 7 V1.0
Dynamic Web Pages Ch 7 V1.0Dynamic Web Pages Ch 7 V1.0
Dynamic Web Pages Ch 7 V1.0
Cathie101
 
Dynamic Web Pages Ch 5 V1.0
Dynamic Web Pages Ch 5 V1.0Dynamic Web Pages Ch 5 V1.0
Dynamic Web Pages Ch 5 V1.0
Cathie101
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0
Cathie101
 
Dynamic Web Pages Ch 3 V1.0
Dynamic Web Pages Ch 3 V1.0Dynamic Web Pages Ch 3 V1.0
Dynamic Web Pages Ch 3 V1.0
Cathie101
 
Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0
Cathie101
 
Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1
Cathie101
 
Database Fdd
Database FddDatabase Fdd
Database Fdd
Cathie101
 
Sql All Tuts 2009
Sql All Tuts 2009Sql All Tuts 2009
Sql All Tuts 2009
Cathie101
 
Database Fdd
Database FddDatabase Fdd
Database Fdd
Cathie101
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009
Cathie101
 
Database Design Fdd 2009
Database Design Fdd 2009Database Design Fdd 2009
Database Design Fdd 2009
Cathie101
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009
Cathie101
 
Overall Computer Systems 2nd Year 2009
Overall Computer Systems 2nd Year 2009Overall Computer Systems 2nd Year 2009
Overall Computer Systems 2nd Year 2009
Cathie101
 

More from Cathie101 (20)

Page Layout 2010
Page Layout 2010Page Layout 2010
Page Layout 2010
 
Css 2010
Css 2010Css 2010
Css 2010
 
Xhtml 2010
Xhtml 2010Xhtml 2010
Xhtml 2010
 
Dynamic Web Pages Ch 8 V1.0
Dynamic Web Pages Ch 8 V1.0Dynamic Web Pages Ch 8 V1.0
Dynamic Web Pages Ch 8 V1.0
 
Dynamic Web Pages Ch 6 V1.0
Dynamic Web Pages Ch 6 V1.0Dynamic Web Pages Ch 6 V1.0
Dynamic Web Pages Ch 6 V1.0
 
Dynamic Web Pages Ch 9 V1.0
Dynamic Web Pages Ch 9 V1.0Dynamic Web Pages Ch 9 V1.0
Dynamic Web Pages Ch 9 V1.0
 
Dynamic Web Pages Ch 7 V1.0
Dynamic Web Pages Ch 7 V1.0Dynamic Web Pages Ch 7 V1.0
Dynamic Web Pages Ch 7 V1.0
 
Dynamic Web Pages Ch 5 V1.0
Dynamic Web Pages Ch 5 V1.0Dynamic Web Pages Ch 5 V1.0
Dynamic Web Pages Ch 5 V1.0
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0
 
Dynamic Web Pages Ch 3 V1.0
Dynamic Web Pages Ch 3 V1.0Dynamic Web Pages Ch 3 V1.0
Dynamic Web Pages Ch 3 V1.0
 
Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0
 
Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1
 
Database Fdd
Database FddDatabase Fdd
Database Fdd
 
Sql All Tuts 2009
Sql All Tuts 2009Sql All Tuts 2009
Sql All Tuts 2009
 
Database Fdd
Database FddDatabase Fdd
Database Fdd
 
Database Er
Database ErDatabase Er
Database Er
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009
 
Database Design Fdd 2009
Database Design Fdd 2009Database Design Fdd 2009
Database Design Fdd 2009
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009
 
Overall Computer Systems 2nd Year 2009
Overall Computer Systems 2nd Year 2009Overall Computer Systems 2nd Year 2009
Overall Computer Systems 2nd Year 2009
 

Recently uploaded

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 

Recently uploaded (20)

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 

Dynamic Web Pages Ch 1 V1.0

  • 1. Chapter 1 Site management & Sending & Receiving data between pages.
  • 2.
  • 3. How PHP Pages are Accessed and Interpreted We will use WAMPS (Windows, apache, mysql, php server) and it will be locally installed on the lab machines.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Common PHP Numeric Operators
  • 21.
  • 22. WARNING: Using Variables with Undefined Values If you accidentally use a variable that does not have a value assigned to it will have no value (called a null value).When a variable with a null value is used in an expression PHP, PHP may not generate an error and may complete the expression evaluation. For example, the following PHP script will output x= y=4. <?php $y = 3; $y=$y + $x + 1; // $x has a null value print (&quot;x=$x y=$y&quot;); ?>
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40. Creating a local site Local folder is your H or F drive etc.
  • 41. Creating a remote site Note: You will have to create this folders, newlandStart. This can be done using the browse button. wampwwis the default directory.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51. Another Full Script Example 1.<html> 2.<head> <title> A Simple Form </title> </head> 3.<body> 4.<form action=&quot;http://webwizard.aw.com/~phppgm/First.php&quot; method=&quot;post&quot; > 5. Click submit to start our initial PHP program. 6. <br> <input type=&quot;submit&quot; value=&quot;Click To Submit&quot;> 7. <input type=&quot;reset&quot; value=&quot;Erase and Restart&quot;> 8. </form> 9. </body> </html>
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66. Retrieving data via URL 2 Select the URL Variable and the screen below will appear. Put the name of the variable from the page calling this one, as shown; firstName The new binding as shown will appear. Drag it to where the variable should be shown. The next slide shows this.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80. unit2sendingpage.php When you click on the “Display Home “ Button the next page appears showing the city that was typed in on this page. If you click on the link “Click Here” then it takes you to the “unit2urlactionpage.php”. The link passes your name in the URL.
  • 81. unit2formactionpage.php Notice, the word “Frankston” has appeared. This was a form variable from the previous page.
  • 82. unit2urlactionpage.php?firstname=Larry Notice “Larry” was sent in the URL and it is displayed on this page. Put your name there instead.

Editor's Notes

  1. 31/08/09 Database php version 2.1
  2. 31/08/09 Database php version 2.1