PHP/MySQL Session
Richard Weinberg
City of Providence (RI)
Started with a demonstration of the PHP Uploader including detailed explanation of the code. It’s a pretty cool little program! One thing he mentioned is that if you create a form input of the type=”file”, the browser will create the browse button and all that interface for you. (include the enctype=”multipart/form-data” in the form tag to make that work, too) Pretty easy! While going through the code, he mentioned the Heredoc syntax:
<<
but no spaces at all or it won’t work <br />
which I didn’t know… <br />
EOT;
that would explain some of the issues I’ve had with this is the past. Doh!!
He just offered us the code for his code tester at php4me.com. That is seriously cool! It’s GPL’d, in case you all decide you want a copy, I could pass it on!! He then showed the read directory code, but I was a bit distracted and missed some of it. Part of the danger in having a computer in front of you…
After that, we went over the alternating row colors on a grid – something I’ve done before, but his example was different, and I still got some good ideas from it. After this, he mentioned the fact that if you save a file as .phps it will show the code instead of processing it. This went into a discussion about trustworthiness (we were deemed to be trustworthy, one of my co-students declared that we were trustworthy, we work for the government, at which point Richard said that 2 of his co-workers are in prison right now – made for an interesting sidebar to the PHP/MySQL information).
After the break, he started on a RSS generating script, something I’ve been using for our Press Releases for a while, but again, he did it differently! Learning new stuff!!
We are going through calendar functions now. I’ve tried dealing with dates/calendars in PHP and generally found that it’s easier to use pre-made solutions on the web… He’s got some great code that I’ll be grabbing for future projects, though!! He followed this up with an email/cell phone weather alert application. Very interesting stuff – I have NOAA alerts on the active desktops on staff machines at work, but I don’t have a push alert system. Hmmm, interesting… His version uses preg_match and cron/curl very extensively. I need so much help with regular expressions, it’s not even funny!
Richard is ending up by answering questions and such from the audience – one of which gave us a really nice example of alphabetizing without initial articles. That would be somewhat handy at my place of work!
Leave a Reply