Ch3 PHP and MySQL for Dynamic Web Sites

Right off the bat the book states there will be three last things to focus on while using php to make websites dynamic;

  1. Using multiple files
  2. Forms (again)
  3. Functions

After this chapter the book will move on to MySQL.

So I wasn’t sure what the book meant by “using multiple files” but when I started reading I got really excited! I had done this in a project for my responsive web development class (well I was the overly-enthusiastic/involved “lead designer”) so I already understood how to do it. Using include and require (and there “_once” additions when needed) you import other html files; often these are footers, headers, or sidebars that are common across many pages. This practice is more secure, easier, and  quite frankly bad ass. I’m excited for class to start up so I can use this!

The reason forms were covered again is because the previous method the book taught involved having one webpage display the form and another handle it, now the book wants to show how to have one singular page do it. This is accomplished buy using a simple if else statement…

if (@_SERVER [“REQUEST_METHOD] == “post” {

//handle form

}else {

//display form

}) 

Sticky forms were also covered, these are forms that retain the info that has been entered into them after the fact. This is done by simply having a php section within each form element that has an isset checking for a filled form and a resulting echo with the value of the forms section given every thing checked out. I will definitely use this…and furthermore have a function to make is easier! To address functions out of courtesy, they were covered here but were nothing crazy or new.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s