scriptygoddess RSS Feed
 
 
 
 

Archive for Lessons learned

Image as buttons (and IE issues)

Oh, this one was going to drive me NUTS! I had to use images as buttons in a form. That's easy enough:
<input type="image" SRC="blahButton.gif" ALT="blah" name="blah" id="blah" value="blah" />
Which works fine when simply submitting the form when there's ONE button. But on one page I had TWO buttons. The form would submit to itself, and [...]

ASP: Look up / translation script

I should create a category called "saved my ass"! This script would fall under it.
I was asked to create a "look up" tool that would sort of "translate" one piece of text to another. The user would enter in the first piece of text, and then they'd be given the "value". Oh, and this list [...]

PHP: simple logic statement

I'm tired of searching for the correct syntax everytime I wan to use this line… if you're doing a simple one line "if" statement, you can use a "ternary conditional operator" – for example:
echo $variable == 'value' ? 'print if true' : 'print if false';

Continue vs. Break (in while loops)

(note to self type post)
Using "continue" in the middle of a while loop will skip the current iteration and go back to the beginning of the loop (checking the while value again).
Using "break" in the middle of a while loop will break the loop entirely. (no more looping)
So this code
<?php
$i = 0;
while ($i < 5) [...]

Button Element

Hello, I'd like to take HTML 101.
So I was working on a form. Used this method to create the form. Minimal HTML. Simple CSS. Started playing around with the :focus pseudo-class… and that's when I noticed my submit button started looking crummy. (From a usability perspective, I think there are some things that SHOULDN'T be [...]

gifs that execute a php script

Problem: (somewhat in line with my last post) I needed to run a script in the "background", but I only had the ability to present the script as a .gif.
Solution: actually, I came up with two ways of doing this and both use .htaccess to pull it off.
1) I'm a gif but really I'm a [...]

Border tricks and centering issues

I'm working on redesigning a site in CSS that I did many eons ago using tables for Christine. While I'm getting the hang of CSS, I still have a long ways to go.
First of all – Christine wants a border around her photos: first a thick white one, then a one pixel black one. She [...]

ASP: get the name of the current page

(Side note: I hate ASP. I love PHP. But sometimes mean people make me use ASP) ;o)
I needed to get the current page name and redirect to a different page if it was a certain name. (ie. 1.asp or 2.asp or… up to any two-digit + .asp)
First – to get the page name I used [...]

OOP in JavaScript.

Guest authored by
Sergey Zavadski – codethat.com

PHP: Hiding Errors

I was running into a problem with undefined index errors. You'll get that if you do seomthing like:
echo $_GET['name'];
when there is no $_GET['name']. One option is to check to make sure $_GET['name'] is set like
if (isset($_GET['name'])) {
echo $_GET['name'];
}
But if you're feeling lazy, you can leave your code as is and just add this at [...]

You are currently browsing the archives for the Lessons learned category.

Categories

Archives

Bookmarks

WordPress Resources

Meta

ADVERTISEMENTS