Showing random quotes isn't anything new. When I needed to do something similar on a site recently, there were plenty of pre-written scripts to choose from. The trick however, was that I wanted to show more than one quote at a time (and of course I didn't want to show the same quote twice. That […]
A recent project I've been working on involved a portfolio page that required a "carousel" type browser. It also needed to have multiple rows (so that images could be grouped into various projects). Also, because this page would contain a large number of images, it was required that the images not be loaded until you […]
I'm sure this has been done before since it's pretty simple – I just couldn't find it quick enough when I needed it. And since it is so simple, it was easier to just create my own personal little calculator than dig around, find one, bookmark. (or worse yet, do the math on a little […]
Well, this was fun! I just made a store locator for a client using PHP and AJAX! 😀 I was basically following the instructions from this page: SomeCoders.com (Retrieving database information with AJAX, PHP and MySQL) Take a look…
How to force a file to download (without having to zip it up). $filename = "secure/writeToFile.doc"; header("Content-Length: " . filesize($filename)); header('Content-Type: application/msword'); header('Content-Disposition: attachment; filename=writeToFile.doc'); readfile($filename); a few other content types – lots more at the above link… "pdf": "application/pdf" "zip": "application/zip" "xls": "application/vnd.ms-excel" "ppt": "application/vnd.ms-powerpoint" "gif": "image/gif" "png": "image/png" "jpg": "image/jpg" "mp3": "audio/mpeg" "mp3": […]
This is one of those things I use all the time but because I can't remember things like this, I always have to look for the exact code to do it… This will take all the values submitted in a form and store them in a session: foreach($_POST as $k=>$v) { $_SESSION[$k]=$v; } And when […]
I needed to set the selection of a drop down menu. As far as I can tell, if you don't know the "index" value, then you just have to loop through to set the item as selected. If there's an easier way to do this, please speak up in the comments. I spent WAY too […]
Because I was having a "duh" moment. $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]
Had to create a plugin. Guess this means I'm getting back in the groove. ;P Referring back to these posts, this plugin will make a button on your edit post/page making it possible to paste some code you wanted to show, select the code, then click "decode" – which will convert your < to < […]
15 Nov, 2005
Posted by: Jennifer In: Scripts
Still on hiatus but wanted to post a little javascript (mainly for my future reference) I've used a few times in various applications. One function will clear the "default" text in a field when the user clicks into it. The second function will replace the default text in the field if the field was left […]
Comments Off on clear default text onClick – restore if nothing entered