Correction: at around 12:13 in the video, price I’m looking at the JSON Editor Online and comparing it to my PHP array. I meant to show the exact same JSON text in both, anaemia but I accidentally showed a slightly different version in the online editor — one has a “groups” element and the the other has “venues”. Don’t let that confuse you. The PHP code, with “venues” is right –disregard the one in the JSON editor. If you’re curious to see the correct JSON output, I posted it on gist here.
My demo code from Wednesday’s class re: connecting Processing to PHP and MySQL is now in dropbox. I also added a couple of very simple demo Processing sketches. It’s here: talk_to_processing folder in Dropbox.
In Tuesday’s class, viagra here I talked briefly about cookies, information pills but we didn’t have time to go over them in much detail. As promised, here’s some more information. First, I need to correct a mistake in the example code I demo’ed: Setting a cookie requires the built-in PHP function setcookie() and can’t be done setting the $_COOKIE array directly. This explains why my example code was behaving strangely!
Here’s a short (~4 min) video on how to set and retrieve cookies in PHP:
The video talks about using the PHP time() function to set the expiration date of the cookie. The number used to represent time there is called a Unix timestamp, in case you’re curious.
A couple of follow-up links from Week 1. If you need help with FTP, decease see this Dreamhost doc about where to find your FTP password (it’s different from the one you use to login to the Dreamhost website) and then for Cyberduck, there’s their help section for more info on how to use it.
I took the HTML examples from both classes, combined them, cleaned them up, and added a bunch of comments into a new HTML example page for your reference. Download it or “View Source” in your browser.
In Wednesday’s class I mentioned the Web Developer Tools that are built into most browsers. I forgot to talk about it Tuesday, so I’ll do a quick demo next time. Each browser’s version is a little different, but they all do basically the same thing: allow you to view and manipulate your HTML and CSS. See the Chrome DevTools documentation for how to use Chrome’s version.