REW Steven's Blog: PHP Programing


Input Validation

photo REW Steven

A very important concept in programing a system that will be used by people is Input Validation. When programmers miss this it can make life difficult for others trying to deal with the data.

As I deal with IDX Data I come across this a lot. I recently had a feed with 32 different spellings of a city name. Many of them were just typos like a semicolon (;) instead of an l ( the keys are next to each other on most keyboards ). Other cases were misspellings or variations of a name. An example would be "Saint James", "St. James", and "St James" ( without a period after St ).

If the MLS Board had Input Validation then users of the system would select the city from a list. This would fix more than just they typos and variations on the same name, it would…

Read Full Post

Posted: 3 years ago, Comments: 0, Average Rating: 5 Views: 723

Some Things To Know About IE 7

photo REW Steven

When using javascript in IE 7, you don't need to use getElementById

Thus in IE 6 you would do:

Code: <script>
var city = document.getElementById('city');
alert(city.innerHTML);
</script>



And in IE 7 you can do

Code: <script>
alert(city.innerHTML);
</script>

city is automatically an object pointing to the HTML tag with the id of that name.

This also means that if you accidentally use a variable with the same name as an id of an element, you will get errors.

I'm sure this gives rise to some kind of security flaw.

Read Full Post

Posted: 3 years ago, Comments: 0, Average Rating: 5 Views: 700
REW Blogs User Stats
Currently Online Users: 0
Total Users: 2,389
Entries: 7,602
Unique Views: 6,444,093
Total Views: 6,781,620
Total Comments: 9,372
Total REW Points: 510
REW Steven

REW Steven I am a PHP / MySQL Programmer for Real Estate Webmasters. I program custom IDX solutions as well as many other custom features on our clients websites. Read More

This User's Stats
Blog Entries: 24
Average Blog Rating: 4
Unique Views: 12,659
Total Views: 13,497
Comments Posted: 14
Comments Received: 25
REW Points: 0