Cross Domain AJAX - A quick anatomy of a mashup
September 19th, 2007 by Aaron
So after searching the Internet for some cross domain AJAX stuff, I noticed two interesting articles. The first was the specifics of writing these queries (located here). Then, the next gave a breakdown of how this might be useful in a mash-up collaborative sense (here).
The one missing point was how the collaboration should occur. There is talk about same parent domain but I think everyone’s forgetting about the DNS/webserver changes that need to happen.
In order to prove my concept on my windows box, I set up the examples. In that previous example, domain D had a subdomain of D_s which pointed to E.
I determined what the IP address of E was and entered that into my hosts file (I don’t have access to a DNS server at the moment) followed by the subdomain D_s.
Next, using apache, I found the virtual host for E, and put in ‘ServerAlias D_s’. This will make sure that the incoming connection to that IP will also respond to that sub domain.
I just wanted to jot this down to help fill in the hole I noticed. ![]()
Pass PHP session to a new script using fsockopen
September 6th, 2007 by Aaron
I was working on a script that opened up a new connection to the same server with fsockopen to process a php script. It passed the variables needed through GET and then gathered the output. Finally, it displayed the output on the screen under the current context.
I ran into an issue where now I needed to set a session variable in my calling script, but make the same session information available to the called script (the called script starts its own session too).
This is how I did it:
Continue reading Pass PHP session to a new script using fsockopen
Live Combined Error Reporting for Apache and PHP during Development
July 20th, 2007 by Aaron
So many times during development, I’ve missed little PHP errors because they were 1) on a processing page that was redirected or 2) output inside of a html tag - and rendered invisible. From time to time, I have to go back to my file system and check the php error log to see what happened. The first step to solving this was implimenting a custom error handler - which we did at (”the triangle”). But I’m torn on this: should the error handler script function the exact same during development as it does in production, or should we write two different error handlers. To keep the code as simple as possible and allow for scenario regeneration, I opted to have the error handler work the exact same way in development. Some might disagree, but thats not the point here. The issue was that I needed to watch the error log closer (I’m notoriously bad at not checking errors - see my previous post about error reporting…).
Another thing I knew would be nice to see would be the apache error log. As I’m not combining my error logs with php, I don’t often check the apache one. However, local mistakes can cause errors on the production server too.
Luckily, I was able to find a utility that made life easier - and of course - integrates into eclipse. Lets configure:
Continue reading Live Combined Error Reporting for Apache and PHP during Development
Security Issue with Subversion Deployment?
July 4th, 2007 by Aaron
I use Subversion (SVN) for source control and deployment both for JEMDiary and at (”the triangle”). While working on my local copy of one of the websites, I got to thinking about the .svn folder and all of its files. The .svn folder is a local cache/db of the file changes in order to support diffs, reverts, and to give cues about file changes and the need to commit. I started poking around inside of the folder - and discovered the text-base folder. Inside of there, every one of my recently changed files were in there with an extension of .svn-base. Could this be a security issue - was I showing my code to the whole world? Lets figure this out:
Continue reading Security Issue with Subversion Deployment?
