After years of confusion I finally found the solution to why php was only serving one page at a time.
When you execute session_start() the session array for that user gets locked to prevent concurrent write errors. Until the script finishes or you run session_write_close() any other script that tries to access that session will stall.
So, the fix is to run session_write_close() after you are done writing session data but before anything time consuming (large shell_exec()s, sql querys, downloads).
Last Friday I performed the Papageno Papagena Duet in San Francisco State’s Opera Gala. Papagena is sung by my friend Sanja Wetzel and the whole ordeal was staged by Alissa Deeter. Video:
If you want to do this again, you’ll hit refresh to generate new quotes, because clicking the quotes link again will just give you the same quotes over and over again.
I found this very funny, so I wrote a quick and dirty script to automate the process, and I must say, seeing an actual image of the album only makes it funnier. Have your debut album automatically generated here. Be patient though, it takes a second to get all the data and put it together. The images are fully bookmarkable/shareable and you can simply hit refresh to get a new one!
I am a member of a web forum which allows you to use an Avatar image of your choice. You simply give them the url of the image. The ability of php to generate images lead me to try to come up with ways to take advantage of this system.
My first attempt at a dynamically generated avatar was thwarted by the sites form verification. It rejected my avatar because it pointed to a .php file instead of an image file. To get around this, I created a directory called:
/avatar.jpg
that contained an index.php file. Therefore when a user requests:
http://www.classicalcode.com/avatar.jpg
the server resolves that to:
http://www.classicalcode.com/avatar.jpg/index.php
and that script generates an image which it then returns with .jpg headers.
Now that the image is dynamically generated, the question is: what can the script do? Currently it logs ip addresses, browsers and operating systems, does a google image search, finds a random image for a search term, and displays that image along with the users ip and the total times that the avatar has been requested. The source code can be found here: avatar_source.txt
What’s all this then?
My name is Jordan Eldredge. I am a musician, a programmer and a geek.
This blog is contains: the results of my various personal projects.
This blog does not contain: rants, ramblings, philosophies, observations, journal entries or personal drama.
Recent Comments