John Hesch

Echoing my thoughts and interests

Archive for September, 2006

Firefox has a really annoying quirk that puts a dotted line around the text in an HTML form submit button. I searched and found some CSS hacks but none of them really worked. Finally I added onfocus="blur()" to the submit button and the dotted line is gone.

Here's the form button after clicking on submit:

using the following code

JavaScript:
  1.  
  2. <input type="Submit" name="Submit" id="Submit" value="Print Order" onclick="this.disabled=true;" />
  3.  

After I add onfocus="blur()"

JavaScript:
  1.  
  2. <input type="Submit" name="Submit" id="Submit" value="Print Order" onclick="this.disabled=true;" onfocus="blur()" />
  3.  

The dotted line is gone.

09-2-06

Beware eBay Phishing Scam

Posted by John

Today I received my first eBay phishing email. The banking institutions and Paypal scams come fairly frequently. Following through with one of these eBay scams can really be costly.

The email looks like this:

As soon as I clicked on the link Google popped up a nice alert telling me that this page is probably a scam.

The scam page looks like this

The URL was not nearly as clever as what I typically see with Paypal phishing scams

The domain lessmann-five.de belongs to Thomas Lessmann in Germany. I wrote to the domain hosting company to see if they would shut down the site. It is likely that Thomas has nothing to do with this scam and the perpretrator has hacked into his server and created the fake eBay page.

Just be careful.

I learned something interesting today. I am finishing up writing a blogging application and I wanted to transfer either a success or error message after a post was created. I was using the following code:

PHP:
  1.  
  2. if ($conn->num_rows == 0) {
  3. $_SESSION['error'] = true;
  4. $_SESSION['message'] = "Your message failed. Please contact the administrator";
  5. header("Location: index.php");
  6. } else {
  7. $_SESSION['success'] = true;
  8. $_SESSION['message'] = "Your message titled <i>$blog_title</i> was successfully created.";
  9. header("Location: index.php");
  10.  

But for some reason the session variables were not transfering to the index.php page. I Googled my problem and come to find out

PHP:
  1.  
  2. header("Location: index.php");
  3.  

gets executed so fast that the session doesn't have a chance to set the variables. The solution is to use session_write_close();. This forces session data to be saved before the browser changes to the new page. Now my code looks like:

PHP:
  1.  
  2. if ($conn->num_rows == 0) {
  3. $_SESSION['error'] = "Create New Message Failed";
  4. $_SESSION['message'] = "Your message failed. Please contact the administrator";
  5. header("Location: index.php");
  6. } else {
  7. $_SESSION['success'] = "Create New Message Success";
  8. $_SESSION['message'] = "Your message titled <i>$blog_title</i> was successfully created.";
  9. header("Location: index.php");
  10.  

Works perfectly!

Graytone | Design: Tenant Report