scriptygoddess

Archive for the ‘Scripts’ Category

01 Apr, 2010

Showing multiple random quotes

Posted by: Jennifer In: PHP|Script snippet

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 […]

13 May, 2008

Proportional Scaling Calculator

Posted by: Jennifer In: Javascript|Scripts

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 […]

13 Feb, 2007

Store Locator using PHP and AJAX

Posted by: Jennifer In: PHP|Scripts

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…

09 Feb, 2007

Force File Download

Posted by: Jennifer In: Bookmarks|PHP Related|Script snippet|Scripts

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 […]

29 Jan, 2007

Get current URL with PHP

Posted by: Jennifer In: Script snippet

Because I was having a "duh" moment. $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]

23 Dec, 2006

Decoder Button

Posted by: Jennifer In: Scripts|WordPress Plugins

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 &lt; […]

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

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements