I ran across an interesting situation where some users of mine were complaining that a form I created “didn’t work”. Kind of strange to get this complaint after almost a full year of operation. I remember testing the xhtml and css design in both firefox and IE browsers and it all checked out. What I didn’t think of checking was the behavior of browsers when one presses the return key. With the help of Fiddler (thanks to Casey Williams for the Fiddler suggestion) this is what I discovered:

IE Firefox
Submit Button Clicked All inputs $_POSTed All inputs $_POSTed
Return Key Pressed All inputs $_POSTed
except form buttons
All inputs $_POSTed

(For a larger, more detailed image click here)

As you can see, when my IE users were pressing the return key, the button itself was not being $_POSTed. So what right? Well what if you were checking if the submit button was pressed before doing any processing? Like so…

< ?php
if(isset($_POST['button_name'])){
    // validate the user entries...
}
?>

This would fail if the user hit the return key in IE7. I haven’t tested earlier versions.

View the example. Test it in both browsers.

Right now the only thing that was suggested to me was to add a hidden field to mimic the submit button in your form like so:

<form ...>
    <input type="hidden" name="button_name" value="whatever"... />
</form>

That works just fine.

From perusing irc and several forums, the only response as to WHY this happens are comments like “It’s IE, what do you expect?”. I’m already annoyed that IE doesn’t think it has to adapt to web standards, but this ont really caught me off guard.

I’m wondering if any readers might have some input on my inputs ;P

squirting pussy pregnant fuck anal group fuck girl foot fetish femdom asian fuck



Comments (1) Posted by ^Lestat on Friday, September 26th, 2008

Ahoy there!
Just a reminder that today is talk like a pirate day! Arggghhh!

All posts and comments for today will be translated in to pirate speak by using the nifty text plugin from Dougal Campbell. It looks like it hasn’t been updated in a while, but it still works. At least in version 2.1.3.

So what are you waiting for people!? Let’s have some fun in the comments!

Hot horny teens Teen nude pictures amateur teen sex Teen Models Hard Fucked nude teen models lesbian masturbation drunk teens teen sex pictures Teen porn movies Teen ass fuck

download sound card drivers for XP

Comments (1) Posted by ^Lestat on Friday, September 19th, 2008

startMenu_snip I was searching my Vista accessories for hyperteminal and stumbled upon a built in screen shot tool in Vista called Snipping Tool. I’m sure to most it’s nothing new, but coming late in the game leaves for more surprises!

You can find it in the start menu -> all programs -> accessories.

By default there is an outline around any window space that you choose to grab. This can be turned off by clearing the check box in the options ->Show selection ink after snips are captured“.

snip_Options

You can take snips of menus and the like this:

  1. Open Snipping Tool
  2. Press Escape
  3. Navigate to the menu, or start menu area
  4. Press Ctrl + Print Screen (PC)
  5. Use the snip tool

Of course to take screen shots of the snipping tool, I needed to use the old stand by Screen Grab Pro. Otherwise it took a selection of the desktop behind the app.

Technorati Tags: ,,

dating articles

Comments (0) Posted by ^Lestat on Tuesday, July 29th, 2008

liveWriter

I haven’t posted much (No, this isn’t a blogpology) lately. Mainly because I haven’t had the passion to write about anything. Secondly because I just don’t want to do the work of messing with the UI and entering one.

Thanks for the tip from my buddy TDavid who pointed me toward Windows Live Writer.

The setup was simple for this machine (Vista Business edition sp1). It’s got some really neat features. First off inserting hyperlinks is a snap. So is adding pictures. Also drag and drop tables, and image resizing.

It also includes preview views, and category selecting, tagging, and you can post date posts.

You can post drafts, post live, and even save drafts locally. I find it much easier to use than the WP UI.

Comments (1) Posted by ^Lestat on Monday, July 28th, 2008

I found myself working with text files a little more recently and was looking for a way to tell if a directory was empty. Why? In my case I wanted to check if a directory was empty. If it wasn’t, to grab the data in those files and put them in a database.

What I didn’t want to do was have the expense of connecting to a database if the directory didn’t have any files in it to begin with. After chatting with my good friend TDavid at php-scripts.com, I decide to run with his suggestion…

Fill (or don’t fill) a variable with information if there were files in the directory. Then test the var to confirm or deny if there are files in the directory. It’s really a small bit of code…

//----- Check if ticket dir has files. If it has files,
// set a variable to hold the list of file names.
 
$dir = "../path/to/my/textfiles";      // set directory
 
if($handle = opendir($dir)){           // open directory
 
	while(($file = readdir($handle)) !== false){
		if($file != "." && $file != ".."){
			$file_list[] = $file;  // Set file list variable
		}
 
	}
 
	closedir($handle);      // Close directory
}

If there are files in this directory, the variable $file_list would not only exist, but also contain files. For example…

Array
(
    [0] => 195972.txt
    [1] => 196027.txt
    [2] => 196053.txt
    [3] => 196067.txt...
)

If there aren’t any files in this directory, the variable $file_list would not even exist because no $file would be inserted into it. At this point we can check/ test the variable to output or do further processing…

if(isset($file_list)){
    echo "This dir has files!";
    // perform further processing
    // eg: collect each files contents
} else {
    echo "This dir has NO files!";
    // stop processing
    // Not much do do with this since there are no files
}

Of course there are a few ways of checking to see if a directory is empty, but this way seemed to be the most simplistic to me. If you wanted to you could turn the entire lot into a function for reuse, and less script code clutter.

Comments? Questions?

Technorati Tags: ,

levitra buy levitra versus cialis soft tabs buying viagra without a prescription ed pharmacy guaranteed cheapest viagra soft tabs propecia propecia propecia generic viagra india generic cialis cheapest order viagra cheapest levitra prices an alternative to viagra soft tabs

natural xanax alternative discount viagra discount klipal Penicillin buy tenuate on line generic lorazepam sold on line viagra online buy cialis natural alternative to diazepam herbal zyban samples purchase levitra discount priced valium rx pills where to buy oxazepam online buying tramadol online uk

latna big tities girls big dick monster fetish small titts hard fetish porn she you porn ass girls big boobs 40 old womens got a sex video big ass boobs webcam online

buy viagra cialis soft tabs prescription uk natural substitutes for levitra where to buy cialis online canadian pharmacy

PORN VIDEOS FREE

shop on-line

Comments (0) Posted by ^Lestat on Thursday, February 21st, 2008