PHP in a Browser!!!

Jun
16
2004

I was messing around with ActivePHP, as I've been contemplating adding its
setup to the Sokkit install. Anyway, the given examples don't work on my
current machine. I'll try them on some others, but it seems to boil down
to the fact that the normal input/output methods don't work. For instance,
you can't do anything with the window object like any sort of alert(). You
also can't seem to do anything with the document object like a write(). I
first thought that the PHP wasn't doing anything, but then I created the
following HTA file (save this code as test.hta or something and double
click) that dumps out the contents of the $GLOBALS variable. Lo and
behold, it worked. However, none of the browser stuff is in there.

 <HTML>
 <HEAD>
   <TITLE></TITLE>
     <HTA:APPLICATION ID="oHTA"
      APPLICATIONNAME="RSS Evaluator"
      BORDER="thin"
      BORDERSTYLE="normal"
      CAPTION="yes"
      ICON=""
      MAXIMIZEBUTTON="yes"
      MINIMIZEBUTTON="yes"
      SHOWINTASKBAR="yes"
      SINGLEINSTANCE="yes"
      SYSMENU="yes"
      VERSION="3.5"
      WINDOWSTATE="normal"
 	 />

 <script language="ActivePHP">
 	function write_file(){
 	$filename = 'test.txt';
 	$somecontent = print_r($GLOBALS,true);

    if (!$handle = fopen($filename, 'w')) {
         print "Cannot open file ($filename)";
         exit;
    }

    // Write $somecontent to our opened file.
    if (!fwrite($handle, $somecontent)) {
        print "Cannot write to file ($filename)";
        exit;
    }

    print "Success, wrote ($somecontent) to file ($filename)";

    fclose($handle);
    return "Success";
 }

   </script>

 </HEAD>
 <BODY bgcolor="menu" scroll="no">

 <button onclick="write_file();return false;">Function
 Test</a>

 </BODY>
 

Then, I was wondering if you can pass values between Javascript and
ActivePHP script. After all, in that case, you could do the heavy lifting
with PHP and interact with the user using Javascript to manipulate the
HTML/CSS. Well, it turns out that, while you can pass data, use functions,
etc. across Javascript/VBScript, you can't do the same thing with
ActivePHP. Not sure why.

At any rate, I think that the use of ActivePHP and HTA's is a promising
way to do quick and easy GUI apps with PHP and would like to see progress
made on these fronts. Anyone who has more information or can come up with
a way past these barriers, let me know.

Dave Mordal Concert

Jun
16
2004

I attended the Dave Mordal show at the Pantages theater in downtown
Minneapolis Saturday night. It turns out that the 2 shows that night were
being recorded to be turned into a comedy album. So, those of you who have
been wanting to see/hear Dave more may get your chance in the near future
on CD. As Dave put it, he can now disappoint people by mail.

The show itself was pretty good. 2 opening acts. I liked both, my wife
didn't like the 2nd act. Overall, a pretty good set, including some stuff
I'm pretty sure he made up on the spot. Occasionally, there were pauses
that were a little too long as he tried to remember what he was going to
say next, but it still turned out to be a good show.

Fontifier - Your own handwriting on your computer!

Jun
11
2004

I ran across this a while back, but may start doing more with it. Fontifier lets you print out a template, write on it, scan it, upload it and get back a TTF font of your results. I ran one through of my handwriting and think it definitely has potential. My initial font was a little too thin for onscreen presentation, but since the scanned results can be manipulated, the next one I do will probably be a lot better.

Viewsonic AirPanel Viewsonic AirPanel 15-inch Smart Display and Dock $499.00 B-APV150P-DOCK-SK1

Jun
10
2004

OK. I really want one of these. ComputerGeeks.com - Viewsonic AirPanel Viewsonic AirPanel 15-inch Smart Display and Dock $499.00 B-APV150P-DOCK-SK1. Too bad they only have 7 left and I can't be dropping $500 on a "want" right now. I'd really like to hook one of these up to a home theater PC and use it as a complete remote. Since I probably won't be ready for the full theater setup for at least 6-8 months, I shouldn't get one, but the technolust is definitely there.

Bad Religion - Empire Strikes First

Jun
10
2004

I bought this album a few days ago, on the day it was released. I've been listening to it pretty much non-stop at work. For some reason, punk helps me write code. Amazon.com: Music: Empire Strikes First

« Older Entries   Newer Entries »

J Wynia

For better or worse, I'm the guy who runs things here. I'm a web consultant, software developer, writer and geek from Minneapolis, MN. This site is a fairly wide cross-section of the things I'm interested in and enjoy writing about.

Oh, and if you happen to be looking for hosting for your Subversion repositories or just web hosting in general, take a look at Dreamhost. It's what I use for Subversion and your signup helps me out.

Latest Microposts

Follow Microposts on Twitter | Subscribe to Microposts

My Attendance At the Gym

Feeds and Links


www.flickr.com
This is a Flickr badge showing public photos from J Wynia. Make your own badge here.

Search


Pages

Archives

Computers Blog Directory
© 2003-2008 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.