Thursday, February 23, 2012

General Web Development

Code Troubleshooting Checklist

So I've started this list to make sure I don't spend so long anymore on debugging code. The aim of this article is to quickly suggest ways of pinpointing the source of the problem:

In a database/web environment, have you?
  1. Commented out lines that you suspect might be the problem?

  2. Able to run the SQL queries directly against the database?

  3. Matched the datatypes received/returned by functions, classes and procedures?

  4. Confirmed any ACL/permissions on the files?

  5. Ensured all global, posted and session variables are present when they should be and behave properly?

  6. Broken down the error in understandable and diagnosable parts?

  7. Checked appropriate services are running?

Questions for the customer
  1. Can you access the service?

  2. Can you open other similar files in the same environment?

  3. Is a colleague experiencing the same issue?

  4. Can you access the service using a different workstation?

  5. Was the last time you used the service recent?

  6. Has anything been installed on your workstation since the service last worked?

Suggestions by Wikipedia
  1. If you are having difficulty understanding a problem, try drawing a picture.

  2. If you can't find a solution, try assuming that you have a solution and seeing what you can derive from that ("working backward")

  3. If the problem is abstract, try examining a concrete example.

  4. Try solving a more general problem first.

 

Basic Tests for SQL-Injection Vulnerabilities

Advise the administrators of the server/service you will be testing SQL-injection. Advise them that your account will need to be unlocked or for your IP addressed to be un-banned.

1. Random SQL
Type some random SQL for the input value and see if the server returns a message
Result should be no matching rows and no error messages displayed.

2. Wildcards
Type an asterisk (*) as the input value and observe
Result should be no matching rows and no error messages displayed.

3. The Classic
Type the following: ' or 1=1-- as the input value.
Result should be no matching rows and no error messages displayed.

   

CSS keeping the footer at the bottom

Spent enough time trying different methods across the web but only 1 article worked for me using the "push" div layer. Loosely based on Ryanfait: Make a Footer Stick to the Bottom of the Page

Aim:
Header

Left


Right

Footer
<div id="container">
     <div id="header"></div>
     <div id="content">
          <div id="left"></div>
          <div id="right"></div>
          <div class="push"></div>
     </div>
     <div id="footer"></div>
</div>
Situation
The header displayed fine. The left and right columns finally got them side by side. But the footer that has a background image was under the left and right columns... The main content layer was overlapping the footer. I tried various z-index's bearing in mind that the footer has to be behind because the main content had a semi-transparent layer that overlapped it half-way.

I managed to fix this by including a div push layer which clears both (even though i had clear:both on the css for my #right div layer). For some reason, it has a more forceful effect in its own separate layer.

   

CSS Fieldset

Add horizontal space between label and fieldset
fieldset label.inline { display: inline-block; margin-left: 2em; }


Change color of fieldset grouping line
fieldset { border: 2px ridge #7abcff; }
   

CSS Background Without Causing Scrollbars

Quick note in case I spend as long as I did again.

A Client had some clouds on the background of his photoshop file for his website. They were to be positioned in the top right corner with the leftmost tip aligned to the right of a central content section. I separated off the clouds as another div layer, specified the width and height and specified it's left. It caused the horizontal scrollbar which is a bit annoying because you scroll to the right and theres nothing but some background image. Also the footer was at 100% so it got cut off if you scrolled horizontally.

Aim / Objective
To have a background of sky and grass with a centered content section (white semi-transparent layer) of 900 pixels width as shown in the following picture:
background of sky and grass with a centered content section (no clouds)

And I want the clouds as another layer ontop aligned to the top right:
background of sky and grass with a centered content section (with clouds)

   

Page 1 of 4

Member Login

Joes Latest Members

A huge WELCOME goes to today's newest members:

  • Rovadisa
  • usardet
  • sirisoma
  • ezdating+in+germanyd2
Member Signups (Activated)
BeforeCurrentTrend
Day24é
Week3216=
Month201106ê
Year2,265307ê

Member Stats
84 guests are currently online.
1,101 members are still deciding.
There are 5,553 members in total.

Latest Comments

Paypal Donations

Want to support my work? Any donation is a blessing :c)