PHP

warning: Creating default object from empty value in /home/coredogs/public_html/modules/taxonomy/taxonomy.pages.inc on line 33.

Client-side validation

Learn:

  • How to get form data into JavaScript variables.
  • How to check that data for errors.
  • How to report errors to the user.

Saving form data to a file

See more about:

Learn:

  • How to append form data to a file.
  • How to read back data from the file.
  • Know how to do some basic security stuff.

Send form data by email

See more about:

Learn:

  • How to use the <textarea> tag.
  • How to use PHP’s mail function to send an email message.

Form data in PHP

See more about:

Learn:

  • How PHP fetches form data.
  • How to fetch data from post and get forms.

The JavaScript connection

  • JavaScript files contain file paths, just like HTML files. The paths can be broken when you use PHP to insert library files.
  • You can fix the problem by creating a JavaScript variable in each file containing the path to the Web root. That variable is added to the JavaScript code in the library files.
  • The JavaScript variable can have its value set by PHP.

A complete template system

See more about:

In this lesson, you:

  • Review a site with layout, images, and animated navigation.
  • See how to create a complete PHP template system for this site.
  • Understand the productivity wins this gives us.

Inserting files with links and images

See more about:
  • Inserting files with paths in them – to images, links to pages, whatever – can break your site.
  • You can fix it with root relative paths, but this makes your site less portable.
  • A better way it to create a variable on each page, giving the path from that page to the root of the site. Add that variable in the inserted files.
  • This gives you a big productivity win. You can change an entire site just by changing one inserted file.

Inserting files

See more about:

Learn:

  • How to use PHP to insert a file into the HTML output, using the require statement.
  • How to use a file path to insert the same file in pages that are spread out across a directory tree.

PHP outputs HTML

See more about:
  • When a Web server gets a URL with a .php extension, it sends the file to the PHP interpreter.
  • You embed PHP code in HTML pages.
  • Most PHP code outputs HTML, which then gets sent to the browser for rendering.

Lessons

How to...


Dogs