Listing the Forms and Fields on a page in Internet Explorer or Maxthon

This post is an introduction to what I’ve been researching in my spare time over the last few weeks. It will be the first in a series of posts about form submission. It will lead you basically along the path that I took in discovering this information, and will hopefully allow you to skip over some of the trouble spots along the way. I’ll note each of the trouble spots in the comments in the doc (for instance in this one I include a note about the value of a button also being submitted with the form).

This HTML file builds on top of the work that I did on with the Copy as Text Link tool referenced elsewhere on this site. However, this routine processes the currently active webpage/frame and generates a report of the Forms and fields on that page. For each form it shows its name, action and then list the inputs on that form. For each input, it shows its name and value. From this information, you can see what is being tracked between pages on a website. You could also use this information to debug an entry form you are creating. It could also be used to generate the form submission information that will be generated by a certain action so that it can be repeated programmatically in the future.

This routine will only work in IE right now and older releases of Maxthon. It could easily be transposed to other browsers and tools. The process should be relatively easy to follow thanks to Microsoft’s Document Object Module (DOM) technology. DOM allows HTML code to be accessed as if it were Object Oriented. In other words, this routine doesn’t work with the HTML source code. Instead it asks IE for specific parts of the webpage one at a time. This allows each of the various parts/divisions of any web page to have its own particular properties and methods. This routine asks asks the document object for the list of forms it contains. It then asks each form for a list of fields. It displays each in its turn.

To install this file in IE, right click on the following link and choose Save Target As. Then in the destination window type %WINDIR%\web\formlist.htm and press enter.

RIGHT CLICK THIS LINK

%windir% is an environment variable that represents your Windows directory. So you can put C:\Windows\Web\formlist.htm if you know you have a c:\Windows directory.

Then choose Start->Run and put in this text and then press enter:

reg ADD "HKCU\\Software\\Microsoft\\Internet Explorer\\MenuExt\\F&orms and Fields" /ve /t REG_SZ /d "%WINDIR%\\web\\formlist.htm" /f


That will update your registry to point to the file. If you have problems, use this batch file instead. It contains the same command but will not be corrupted by windows.

Then close all instances of IE.

Now browse to a web page that has a form, most of them do now-a-days.

Right click anywhere on the text of the form and choose Form and Fields from the menu.

You’ll now be able to see all sorts of information about the page you were on and the fields and hidden fields it contains.

BTW, this routine uses a pop up window. Popup blockers like the Google Toolbar will try to block this form. So, you just might have to hold down the CTRL key as you choose Form and Fields to allow this to work.

Also, FYI it works in Maxthon through at least version 1.5.2 build 21. I think build 23 reworks the context menu stuff, but don’t quote me on that.

Enjoy!

Sample output from FoxNews.com

(Source code follows)
NOTE: There is now a reference to the final location of this file in the source code. If you install this as something other than c:\windows\web\formlist.htm you must now update the source code.

Continue reading Listing the Forms and Fields on a page in Internet Explorer or Maxthon

Goodbye Sysinternals! Hello MS RootKit Revealer..

I was shocked when I followed a link from the ZTree forum over to Winternals.com. Winternals and Systernals are sites that host some of the very best and most unique core operating system tools out there and most of it is free…

This announcement comes one week to the day after the Austin Texas based Winternals, with its 80+ employees, reached a settlement with Best Buy and its subsidiary Geek Squad. So, this is a bangup month for Winternals.

Even the non-geek heard of the firestorm that erupted over Mark’s discovery of a Root Kit installed by Sony CDs. Well, that discovery was made while he was beta-testing a recent version of RootKit Revealer, one of the may free tools he offers on his site. Well, now we have to call it the Microsoft Rootkit Revealer.

Mark is no stranger to the people at Microsoft. It is unlikely that his near-celebrity status was what drew Microsoft’s eye. In fact, I beleive Mark has been a key speaker at Microsoft’s Technet Canada’s IT conference Energize IT!

So, now Mark has a chance to take their advice to “Get your geek on!” for real. The Winternals FAQ of course views this as a very positive move:

Winternals and Sysinternals have been acquired by Microsoft. Winternals is a leading provider of systems recovery tools for Windows-based enterprises worldwide and Sysinternals is one of the leading community and enthusiast sites for people interested in information about the internals of the Windows operating system.

This can only be a good thing for founders Mark Russinovich and Bryce Cogswell personally. And I wish them all the best. Mark blogged:

I’m joining Microsoft as a technical fellow in the Platform and Services Division, which is the division that includes the Core Operating Systems Division, Windows Client and Windows Live, and Windows Server and Tools. I’ll therefore be working on challenging projects that span the entire Windows product line and directly influence subsequent generations of the most important operating system on the planet. From security to virtualization to performance to a more manageable application model, there’s no end of interesting areas to explore and innovate.

You see that term there? “Technical Fellow” – that’s a BIG deal. That means he’s regarded as one of the top 14 technicians at Microsoft. To quote Bill Gates: “Impressive. Most impressive.” or was it Bill that said that? anyway, the big question is if that innovation will be stifled by the obligations entailed in managing a software package with such a wide global distribution.

And what is going to happen to all of those free tools from Sysinternals?

Mark tells us:

Microsoft is still evaluating the best way to leverage the many different technologies that have been developed by Winternals. Some will find their ways into existing Microsoft products or Windows itself and others will continue on as Microsoft-branded products. As for Sysinternals, the site will remain for the time being while Microsoft determines the best way to integrate it into its own community efforts, and the tools will continue to be free to download.

Well, I’ll wager that Mark and Bryce are off on a two week island vacation right about now and I think I’ll go start downloading the existing tools now… Ta!

PS: I feel like I should apologize to Bryce Cogswell. He’s just behind the scenes in this move. I get the feeling he’s Winternals Paul Allen. With Paul’s personal assets of $22 billion USD, I suppose there are worse comparisons to be made…

PPS: It is interesting to note that people have begun to point to the missing LockSmith download page as an indicator of MS’s plan for the free tools. (Google Cache of the Page) I think it is more likely that during the rebranding of the SysInternals site, they got rid of a page that described a tool that could no longer be downloaded outside of the Administrators Pak. Perhaps bad timing on their part.

Related articles:

If you like this article Digg It! ( My first attempt at Digg’ing. I feel like that frog from Kellogs but I guess he was Diggem…)

New Blog Feature – Now Reading….

I’d decided to install Rob Miller’s “Now Reading…” version 4.0 plugin ages ago to replace my Read in 2005 and 2006 categories. But I knew there was a new version of my current theme out. So, it didn’t make sense for me to manually add the required template changes especially when the new version of Binary Blue supported Widgets and writing a Now Reading Widget woud be simpler than updating the template all the time. Skip a few months and now Rob himself has investigated widgets and made his own available for Now Reading. So I rushed over to his site, grabbed it and installed it right away! S0000 SWEEET!

Unfortunately, my excitement got the better of me. I failed to notice that the download page for Now Reading had, not only the widget available, but also an updated version of the plug in. The current version of Now Reading was 4.2 and installing the plug in with 4.0 caused the side bar to blow up with a missing function error. I realized my probably mistake right away, uninstalled it all and reinstalled in the correct order with the latest.

Unfortunately, my woes did not end there. I found three problems with 4.2 that could be fixed with relative ease. The first problem was a ” *Fatal error*: Cannot redeclare now_reading_add()” Error. That was very easy to find. I had one link that didn’t work and one link for the same page that did work. A quick change to make now-reading-admin.php always use the “post.php?page=now-reading-add.php” syntax instead of “post.php?page=now-reading/now-reading-add.php” and the problem was solved.

The next problem was a “1 book *Warning*: Cannot modify header information -” error message that came up each time I edited a book. That looked just like a debug comment, and indeed Rob confirmed that this one was fixed in his own code already but didn’t say how. I didn’t have access to check out the latest code yesterday, so I fixed it myself. The total_books routine takes a parameter to termine whether or not to print to the screen. In one place, the parameter was needed but not specified. So I changed
if ( $count > total_books(0) )
to:
if ( $count > total_books(0, false) )

and that problem was solved.

I sent those two changes and a recommendation that the widget check for the correct version of the plugin to him and he replied with a thanks, he’d put in the changed the code as I’d suggested (b4 or after I don’t know) and notice that 4.21 was released! Cool, that means no one else should get these errors.

Unfortunately, I noticed two minor things after that point. First, one book I entered had an apostrophe in the title. Unfortunately, the plugin now put a slash in front of the appostrophe. I SUSPECT that this is a WP 2.03 issue and I have not reported it to Rob. I’ll install 2.04alpha/beta/whatever soon and see if the problem goes away.

The next minor issue was reported to Rob with the fix. After I put in the 12 books I read this year, the plugin was reporting that I had an average of 144 books a month. I admit that my 2 books* a month average this year is pathetic compared to last year’s 3.6 (I read nothing in March this year oddly enough – I guess that’s when I started the blog and nothing struck me as interesting enough to take my time away from that. And I’ve also been reading a lot from Orson Scott Card’s Intergalactic Medicine Show), but I’m not going to bolster it to 144 books a month…

So, I dug into the average query and found the problem…

I shot another email to Rob just before two this morning:

>I’ll add a version check to the widget now, good idea.
Thanks!

Oh and I have one more update if you haven’t fixed this one already too..

Your average books calculation was off. You’re missing a MIN statement around the b_added.

So it should look like this:
SELECT
( COUNT(*) / ( TO_DAYS(CURDATE()) – TO_DAYS( MIN(b_added) ) ) ) AS books_per_day
FROM
{$wpdb->prefix}now_reading
WHERE
b_status = ‘read’

Nice plugin… Now I’m just trying to remember all of the books I’ve read so far this year… I just remembered another… So that’s 12…

That change is in template-functions.php around line 145. I think I’ll keep my current version installed till the fix is out.

So, now you can look at my sidebar now and see all of the books I am reading and have read this year. And if you like the idea of any of the books I’ve read, you can purchase it through the links and I’ll get a peice of the action. (Actually for now Rob will. I’ve not put in my own Amazon ID yet.) I don’t think I’ll put in last year’s 44+ books for a while yet. Each book deserves a comment but that’s 44 more blog entries I need to write. So, I’ll piece meal them in. If you like what you see, please visit Rob’s site and download the latest and greatest versions of now reading. Just click this link: http://robm.me.uk/projects/plugins/wordpress/now-reading/

BTW, I put together the promised context menu post I mentioned the other day, but was debugging something and decided to backup the file and wipe out most of the file so that I could Isolate what I was debugging. Unfortuately, I forgot I’d also already changed the name of the working file. *smacks head* So, I lost some of my change and all of my extended commenting. I just need to re-review the comments ( the second time you put in comments they are never as good as the first time you put them in ) and I’ll publish the post. Probably tomorrow. I’ve got a lawn to mow and a carpet or two to shampoo… Cheers!

* One of the people in our shipping department had a discussion with the UPS guy saying both stated that they’d each only ever read 1 book cover to cover. How sad (not not meaning pitiful but saddening) is that…

Measuring a site’s popularity

I was going to post this to wp-hackers in reply to a couple other posts but decided it was WAY to off topic
[wp-hackers] Close old comments and pingbacks: feature or plugin? Jamie Holly
[wp-hackers] Close old comments and pingbacks: feature or plugin? David Chait

I decided it is too off topic and Robert Deaton would get on my case again. 😉 I didn’t want to waste the typing. So you all get an extra post today…

> I’d have more fun designing for a site getting .75M hits/day —
> send me some of that traffic! 😉

0.75m is 0.75m, Kudos to Jamie. Actually I guess its .36m/day between the two sites. Still in large part, I ignore hits when figuring out how my sites are doing…

More specifically, I can’t see how it much helps in comparing two sites either. My reasoning: To go to an extreme, if a site is Flash based, I’d assume the hits/visit is low as it would be with a largely text based site – perhaps even < 10 hits per visit. If a site has lots of graphics and little tag images (translation flags, "new" buttons, whatever), I would assume the hits/visit are WAY higher. My hits per visit is around 47 - I suspect I should try to lower that. So, if I use only hits as a measure and compare myself with a text based site with 12 hits per visit, my hit count would be four times higher but we would get the same level of traffic. And even that ratio is subject to the definition of "a visit". I use two different stat engines to evaluate my sites: AWStats and WebStatistics. AWStats often reports "Unique Visitors" to be as low as 1/3 of the "Unique Visits" reported by WebStatics. Part of the difference there is the visitors/visits issue, another part is awstats filtering out search engines and another part of it is AWStats has a much more liberal definition of what constitutes a single "visit". I'm just not certain that I have a number of people spending an 1+ browsing my site. It's really cool if I do, but I suspect it is people returning to the site (tab) once or twice within a 2 hour period. Am I correct in saying that the ONLY way to compare the traffic between two sites is to look at the same stat by the same stat engine on both sites (e.g. comparing "Number of visits" in AWStats.)? Am I way off on this? As I said at the beginning. 0.75m/day is 0.75m. That's more traffic then any of my current sites will ever see. What is the best method of measuring a blog's popularity? I know it isn't alexa... I currently have half the traffic of my wife's site but Alexa sure doesn't show that... http://www.alexa.com/data/details/?url=Thecodecave.com http://www.alexa.com/data/details/?url=www.knitchat.com Denise's site has been around for almost two years vs four months for my site. So, I'm pleased with my progress. "My unique Visitors" have been doubling each month. I don't think that will happen this month since I have missed half a month of posts, I expect only a 20% increase over last month... But all's good...

How to run PHP5 on 1and1.com in 1 easy step…

It actually can’t get any easier than this.

Just put the following line in your .htaccess file:

AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php

And your done! Your site is now running under PHP5.

Enjoy…


Want proof? Want to know details?

Well… Here you go…

It turn’s out that 1and1.com accounts all come with PHP4 active. By default php files are processed by PHP Version 4.4.2.

Test this out on your 1&1 server without affecting the operation of your site:

Create a new directory called TestPHP4

Create a file in that folder called index.php that contains the following text

[php]

phpinfo();
?>

[/php]

Then open that directory in your web browser.

You’ll get something that looks like this:

PHP Logo

PHP Version 4.4.2

System Linux infong 2.4 #1 SMP Wed Jan 18 14:53:29 CET 2006 i686 unknown
Build Date Feb 6 2006 10:16:02
Configure Command ‘../configure’ ‘–with-pear’ ‘–with-mysql=/usr’ ‘–with-zlib’ ‘–enable-debug=no’ ‘–enable-safe-mode=no’ ‘–enable-discard-path=no’ ‘–with-gd=/usr’ ‘–with-png-dir=/usr/lib’ ‘–enable-track-vars’ ‘–with-db’ ‘–with-gdbm’ ‘–enable-force-cgi-redirect’ ‘–with-ttf=/usr/’ ‘–enable-ftp’ ‘–with-mcrypt’ ‘–enable-dbase’ ‘–enable-memory-limit’ ‘–enable-calendar’ ‘–enable-wddx’ ‘–with-jpeg-dir=/usr/src/kundenserver/jpeg-6b’ ‘–enable-bcmath’ ‘–enable-gd-imgstrttf’ ‘–enable-shmop’ ‘–enable-mhash’ ‘–with-mhash=/usr/src/kundenserver/mhash-0.8.9/’ ‘–with-openssl’ ‘–enable-xslt’ ‘–with-xslt-sablot’ ‘–with-dom’ ‘–with-dom-xslt’ ‘–with-dom-exslt’ ‘–with-imap’ ‘–with-curl’ ‘–with-iconv=/usr/local’ ‘–with-freetype-dir=/usr/include/freetype2’ ‘–with-bz2’ ‘–with-gettext’ ‘–enable-exif’ ‘–with-idn’ ‘–enable-mbstring=all’
Server API CGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/lib/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606

Now copy and rename the TestPHP4 directory as TestPHP5 (or create the directory as above manually). Now create one more file in the TestPHP5 directory named .htaccess

Make certain a period is in front of htaccess like this: .htaccess

The period indicates this it is a hidden file. It tells your system how to process requests. In this case we will tell it to process all .php files as php5 files. That is done by adding the following line:

AddType x-mapp-php5 .php

Now save that file and browse to the directory with your web browser. You’ll see something like the following:

PHP Version 5.1.4

System Linux infong371 2.4.28-grsec-20050113a #1 SMP Thu Jan 13 08:59:31 CET 2005 i686
Build Date May 4 2006 13:56:29
Configure Command ‘../configure’ ‘–program-suffix=5’ ‘–with-pear=/usr/local/lib/php5’ ‘–with-config-file-path=/usr/local/lib/php5’ ‘–with-libxml-dir=/usr/local/php5’ ‘–without-sqlite’ ‘–with-config-file-scan-dir=.’ ‘–with-mysqli=/usr/local/mysql/bin/mysql_config’ ‘–enable-soap’ ‘–with-xsl=/usr/local/php5’ ‘–enable-mbstring=all’ ‘–with-curl=/usr/local/php5’ ‘–with-mcrypt=/usr/local/php5’ ‘–with-gd’ ‘–with-pdo-mysql=/usr/local/mysql’ ‘–with-freetype-dir’ ‘–with-libxml-dir=/usr/local/php5’ ‘–with-mysql=/usr/local/mysql’ ‘–with-zlib’ ‘–enable-debug=no’ ‘–enable-safe-mode=no’ ‘–enable-discard-path=no’ ‘–with-png-dir=/usr/lib’ ‘–enable-track-vars’ ‘–with-db’ ‘–with-gdbm’ ‘–enable-force-cgi-redirect’ ‘–with-ttf=/usr/’ ‘–enable-ftp’ ‘–enable-dbas’ ‘–enable-memory-limit’ ‘–enable-calendar’ ‘–enable-wddx’ ‘–with-jpeg-dir=/usr/src/kundenserver/jpeg-6b’ ‘–enable-bcmath’ ‘–enable-gd-imgstrttf’ ‘–enable-shmop’ ‘–enable-mhash’ ‘–with-mhash=/usr/src/kundenserver/mhash-0.8.9/’ ‘–with-openssl’ ‘–enable-xslt’ ‘–with-xslt-sablot’ ‘–with-dom’ ‘–with-dom-xslt’ ‘–with-dom-exslt’ ‘–with-imap’ ‘–with-iconv=/usr/local’ ‘–with-bz2’ ‘–with-gettext’ ‘–enable-exif’ ‘–with-idn’
Server API CGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/lib/php5/php.ini
Scan this dir for additional .ini files .
PHP API 20041225
PHP Extension 20050922
Zend Extension 220051025

You now have two different directories that process files using two different php engines.

Pretty cool huh?

I am back! I have Internet access at home again!!!

Sorry for the long absense… I’m back online – This post describes all the bloody details of dealing with Time Warner Cable’s customer service. It’s a rant. You can skip it if you like. But, this is the second time the process was this rocky and I suspect it won’t be the last time… The only good thing we can say is that they are VERY good at appologizing, they offer credit for down time readily and when you get their support reps to your house with the needed equipment, the service is good and the people are polite and compent.

It took Time Warner Cable let’s see….

1 appointment? Nope! That appointment was canceled by them when my wife was checking the mail with out her cell phone and calling TWC back within 5 minutes of the original call counted for nothing. – They are supposed to call 3 times.

2. appointments? Nope! A very angry call from me to a support rep had gotten them to schedule another visit the same day as the first – or at least that’s what I was told.  This person never showed up and the person I spoke to did not record that I’d even called because she thought it was all taken care of. 

3. appointments? Nope! A nice competent worker showed up at the end of the day when he didn’t have enough supplies to correct the problem.  The problem?   The last time they had been to my place to bury the cable line (they didn’t want to have it running through the air because ladders were difficult on my side hill) they most likely knicked the line.  That experience involved many appointments and no records that I’d called and left complaints.

4. appointments? Nope!  Though scheduled for the next day, it seems my job was never given to the contractor.  I got a full months credit out of that call to their support department.

5. appointments? Nope!   The late in the day scheduling – and we SHOULD have been first thing in the morning after all this – meant that thuderstorms had rolled in…  I can’t blame the guy for not wanting to go up the pole with lightning around…

6. appointments?  Almost…  A local contractor came out and re-ran the line.  I like that they are using local small business contractors.

7. appointments?  Maybe…. They have to schedule at least one more visit because the person that ran the line could not bury it.  At least I have the Internet back…  until a squirrel chews through the line tomorrow… 😉

As annoying as it was for me – not having reliable cable internet since July 1, it has been triply so for Denise as for EVERY day except for the 1th and 6th  appointment, she was obligated to constantly be on guard from 8am-8pm for a call from Time Warner knowing that any the 5th ring, could mean another blown appointment.  Additionally, the contractors are not obligated to call… So, she was expected to remain home all day long.  A nice half a month there…

Anyway, I’ll clean up the stuff I’ve been building up for posts and hopefully get something tech related out tomorrow (God willing and the Squirrels don’t arise…).  I’m pretty sure the first thing will be another context menu tool for use in IE.  Then a Xampp tip, another IE tool and by that time I should have some neat Delphi stuff ready for anyone who uses 1and1.com and wants to use their URL for dynamic DNS serving…  Hmmm I should probably make a post of the manual way to do DynDNS through road runner first…. 

Anyway, all that is coming…

WordPress 2.1 Bug Hunt….

This is a post testing WP 2.03 action compared to 2.1

You can see the same action in WP 2.1 here:

http://www.thecodecave.com/21/

And the issue is logged here:

http://trac.wordpress.org/ticket/2918 

 

This should be raw text no link

Here is text again

this is more

 

This text will have an image inserted

SP

between it

This text will have an image inserted

between it and then it will be deleted

 

This text will have an image inserted

SP      

    

 

between it and then it will be resized

 

 

Inserte & deleted and reinserted

SP 

 

 

this is no link

The Oracle: The Lost Secrets and Hidden Message of Ancient Delphi

I was dissapointed that not a word was mentioned about Borland or DevCo in this article… I don’t even see Allen Bauer’s name once!

http://www.findarticles.com/p/articles/mi_m2843/is_3_30/ai_n16418748

The Oracle: The Lost Secrets and Hidden Message of Ancient Delphi
Skeptical Inquirer, May-June, 2006

The Oracle: The Lost Secrets and Hidden Message of Ancient Delphi.
By William J. Broad.
The Penguin Press, New York, 2006. ISBN 1-59420-081-5.304 pp. Hardcover $25.95,

The ancients said the Oracle of Delphi regularly inhaled sacred vapors streaming from the depths of her temple. But in 1892 French archaeologists unearthed the temple and found no evidence of a chasm from which the vapors might have emitted, and after that scholars denounced the Oracle as a fraud. Now the accomplished New York Times science reporter Bill Broad chronicles the investigation by Wesleyan geologist Jelle deBoer and archaeologist John Hale, who eventually determined that the ancient fumes were petrochemical vapors containing a hallucinogenic gas–ethylene–emitted from natural faults hidden beneath the temple floor. Their paper, “New Evidence for the Geological Origins of the Ancient Delphic Oracle (Greece),” was published in Geology in August 2001. Broad entertainingly tells the story of their discovery, weaving in ancient findings and modern philosophical discussions about science and religion. The discovery solves the mystery of how the Oracle got high, yet Broad feels that the larger questions, “the surrounding layers of mystery,” remain. He notes the need for skepticism about psychic powers but argues against overly narrow scientific reductionism that may blind scientists to larger mysteries.

Grrr… Dead cable modem – mostly…

It looks like I’m gonna be mostly offline, at home, until Thursday that’s the soonest RR will be able to come out to diagnose why the internet connection is soooo bad…

In the meantime, sticking the cable modem in the freezer for a time works to get me on line for a bit. I’ve also McGyvered* a cooling fan, from an old dead Pentium 1 computer, onto the side of the cable modem… That seems to help too.

The important thing is that I had enough online time to download last night’s Doctor Who. Anyone else watch it yet? I had to pry my wife’s hands off of the chair… And the kids were yelling, “I’m scared of …” well, you’ll find out what…

(*McGyver was a TV hero in the US that could fix anything with some gum, a toothpick, and a 3 inch piece of string.)