Update Your JSON Data via Working With Data on the Web


show more Updating your JSON data provides you with in-depth training on Developer. Taught by Joseph Lowery as part of the Working with Data on the Web show less
please wait ...

Updating your JSON data

In this lesson, I'm going to demonstrate one technique for storing values entered through a form into JSON format. We'll be using PHP, but most server side languages equivalent syntax. As you'll see, it's surprisingly straightforward. So I'll go to my code editor Where I've got index.php from the Chapter Four 04, 03 folder up and running. Now there's a form on this page starting around line 40 I believe. Yep, there it is. That asks for name, email, and date of birth, and other data.

The code we'll be using is not form specific however, and can be used with most if not all forms. So we're going to put our PHP block however at top of the file. I'll make a little room and start off with our PHP code block. The form on this page is setup using the POST method and an empty action so when it's submitted the information will be posted to the same page. To make sure the code is run only when that happens, we'll add an if statement that checks to see if submit is s...

Updating your JSON data
Video duration: 6m 1s 2h 21m Intermediate

Viewers:

Updating your JSON data provides you with in-depth training on Developer. Taught by Joseph Lowery as part of the Working with Data on the Web

Subjects:
Developer Web
Software:
HTML XML CSS JSON YAML
Author:
please wait ...