Jan 24

So I wrote a quasi-class for a shout box. I say quasi-class mostly because the class is really written for just this application. I have to go back and write it so that it can be expanded a little more. Anyway its free, free to use, free to modify, free to do whatever. Just keep my original creds in the php file?

This shoutbox runs off of PHP 5, if you need a PHP4 version just ask. Also if you have any feedback on what I could make better comment!

config.php file contains some constants that you will need to set to use the application. Try not to move things into different folders. If you do be sure to change the reference directory to the right path.

this is what it looks like:
You can view the admin section
username: admin
password: password

as you can see in the admin section, the e-mail address of the user who commented is visible.


Hope you like it!
I am thinking of writing one with a database connection, because I know if you have 2 people trying to write to the same file at once, it just doesn’t like it.

Resources:
» comment_box.zip

Jan 22

As I was browsing the Yahoo Answers Computer Programming and Design section someone asked “How do I write solid text on a transparent background.”

Looking at the question I didn’t actually know how, so I thought I would solve that problem.

The biggest problem is that IE and Firefox both work differently. Yes I know that is the oldest problem in the book but it is quite annoying. Second When you make a div transparent any child (divs within divs inherit the properties of that div).

So you have to separate the divs, this posses a problem because you have to sort of stick the text div on top of the transparent div.

Code Below:

body {
background: #ffffff;
}
#image {
background-image: url('images/lol.jpg');
width: 300px;
height: 600px;
margin: 0 auto;
border: 1px #666666 solid;
position: relative;
z-index: 10;
}
.trans {
opacity:.50;filter:
alpha(opacity=50);
-moz-opacity: 0.50;
width: 300px;
height: 30px;
background: #000000;
float: none;
margin-top: -70px;
position: relative;
z-index: 50;
}
.text {
float: none;
display: block;
position: relative;
z-index: 90;
color: #ffffff;
width: 280px;
height: 50px;
padding: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
margin-top: 10px;
}

HTML:

<body>
<div id="image">
<div class="text">
Solid Text on a transparent Background
</div>
<div class="trans">
</div>
</div>
</body>

Jan 19

A CAPTCHA system is used by many websites to determine if the user who is accessing the site is human.
This really reduces on the amount of “spam” messages that get sent through online forms.
Unfortunately this system is usually limited to those who have vision as they provide a visual way of accessing site information:
EXAMPLE:

CAPTCHA

This is totally unreadable by auditory readers.
My co-worker came up with a new way, where auditory readers can still have access to the information on the site while no overly complicating the entrance with a “click here to here a sound” mentality than many sites have gone to.

MATH, now I know that may sound weird, but it really works.
When a bot comes to a site and tries to submit a form and they encounter a simple math question, they can’t do anything.

//HOTSHOT was right, bots can be written for this, I guess this CAPTCHA is really written for a small business that an outside spammer really doesn’t care about writing a specific script for. I wasn’t suggesting for Google or Yahoo to start using this system. But Hotshot, I didn’t think about that to much.

Thanks!
But a human can easily add two numbers together. This method of asking a simple question to determine if a user is human is a very good alternative to elaborate accessibility features. And only requires 2 things.

1. a session to store the number
2. backend to compare it.

I have used this in my contact us section on my home page: ww.x24d.com

HTML:

<label>What is the sum of ?</label>
<input name="cap" type="text" width="20" />

PHP:

<?

session_start();

$num1 = rand(0, 50);
$num2 = rand(0, 50);

$_SESSION['SUM'] = $num1 $num2;

if($_POST['cap'] != $_SESSION['SUM']){
$errors = true;
$_SESSION['SUM'] = ""; //always clear your session so you don't have to worry about re-declaring the wrong number
} else {
$errors = false;
$_SESSION['SUM'] = "";
}

?>