Results tagged “programming”

Reading AJAX for Dummies

Reading AJAX For Dummies
Photo of the day: AJAX, laundry detergent household cleaner and Ajax, Asynchronous Javascript And XML web programming language.

Secrets Behind Alumni Directory

Since I worked Alumni Association of WPSD website for more than a year, and I never get tired of this. I would say biggest thanks to James DeBee when he first asked me that he want me build login system in alumni website. Since then, I bought several my ideas in website for fun part of my work: security level, managements, wiki of Alumni Directory, and blog tools of WPSD News. Without of James' idea for login system in alumni website, all of my ideas would be lagging or very late today.

Now, I have been thinking so much time which I would love to share with you about secrets behind Alumni Directory. I have investigated most of my time to make sure there is no sensitive information to show you what the secrets exposed in Alumni Directory.

What is Alumni Directory and what does this offers? This web site includes the whole list of alumnus names, find some of their geographically locations (mostly in United States), some of every pictures of class group who graduate their year, view list of deceased and association names. Also there is the search function for first, maiden and last names to pull up the current contact information. I used MySQL database and migrated those with PHP into the web site on the fly.

First thing, if it is your first time to go there, you might need to register and confirm your Alumni account, to access into Alumni Directory. The other thing about alumni password-protected login, I developed and created five levels of security in Alumni login system; each security level is: Admin, Board Members, Alumni, Student (WPSD) and Guest. For example, you logged in as alumni of security level; you can access the whole information in our alumni site. If you login as student, you have only limited access to pages, such as History pages, vice versa. Alumni Directory is open for everyone in all five levels. However, the admin can have their authorization to change the security levels on the users.

I developed the friendly browser interface or GUI (Graphics User Interface) front-end database on Alumni Directory site to add, edit, modify and delete its data. It is only allowed for board members to view these; they can have their time to change in anyplace on web browser. You could sneak between two screens what these looks like:


Top: Logged in as Alumni security level
Bottom: Logged in as Board Members security level

RegExLib to Rescue

Since you know that I am developer and programmer for the web applications in my full-time Mellon employee and my freelance work. I spend countless minutes and hours of my time building the regular expression rules for inputting the characters in web form to beat glitches, bugs and weirdness.

I found the most useful site, RegExLib.com, the Regular Expression Library. This is free, open source for everyone to look and find the right regular expression, to set this expression string in any programming languages (PHP, ASP.NET, Perl, etc.) instantly. It could save me the amount of time at work.

If you're programmer, you might not miss this one. Bookmark this!

Bad Password Part Two

From Part One.

I shut down the login system in WPSDAA web site on Wednesday, January 19th to avoid the growing problems from users unable to log in. I have been thinking for two days since I do not want to destroy the register users where they store the name and emails in login system and have to start over again to register new ones.

I got good idea how to solve this: creating a new password column in database. So, I made the flowchart diagram to solve this problem in WPSDAA user interface. Here how it works:

wpsdaa-login-diagram.gif

Last Saturday January 22nd I spend all night fixing, debugging and testing the login system includes register, change password, forgot password, and log in to see if it works. It worked really well.

Also in MySQL function, I have used new Encryption Function, to avoid using PASSWORD() function which was used before Wednesday, January 19th. Please note to yourself, this new encryption function for administrator may not see the users’ password, they only see the encryption password, instead users’ words, there is no way to decrypt (or change) this back to normal password. It is safe to prevent the hackers, also bring the users to show our honest and trust. The function code remains confident only for me.

However, few days later, I spend some of my time reading MySQL developer’s reference manual web site about Encryption Function, and I found answer that I could restore the old password in WPSDAA web site login system:

OLD_PASSWORD() is available as of MySQL 4.1, when the implementation of PASSWORD() was changed to improve security. OLD_PASSWORD() returns the value of the pre-4.1 implementation of PASSWORD()...

...the --old-passwords option is to allow you to maintain backward compatibility with pre-4.1 clients under circumstances where the server would otherwise generate long password hashes.


I could do that, but I pefer to use new encrypted password for application user just like login system in WPSDAA web site. Amazing, I worked harder, not surrender myself to bring WPSDAA web site much alive.

Bad Password Part One

A year ago, I developed the login system in Western Pennsylvania School f/t Deaf Alumni Association (WPSDAA) website. The login system’s function is used by PHP server side scripting and MySQL database. Most of the scripts I learned from the book, Visual QuickPro Guide: PHP and MySQL for Dynamic Web Sites.

Last Wednesday, January 19th, I just found out myself that I can’t login in myself by using email account and password. It kept saying 'bad password', and I am puzzled with this. Even whole numbers of the alumnus members users cannot log in. I went over to PHPMyAdmin front-end MySQL database administration to see what’s wrong and tried to run the test with SQL query:

SELECT * FROM [table] WHERE email='[email name]' AND password=PASSWORD('[password]')

The result appears nowhere. Lastly, I tried the simple SQL query to see my password compare to my login password:

SELECT PASSWORD('[password]')

The result: the encrypted password is very different than my login encrypted password. I suspected that web hosting, ProHosting has updated a new version of MySQL database and PHPMyAdmin. I emailed to them about this and they replied me back that it is all true. I am extremely very angry with this; because there is no way that I could solve the password situation with my two hundred sixty WPSDAA register users. The MySQL password function is translated into an encrypted password, which I can't see the users' password secrets and there is no way for the decrypt this back to original ones.

I went MySQL developer’s reference manual web site to search the different way to solve this problem. In article of Encryption Functions, they said:

The PASSWORD() function is used by the authentication system in MySQL Server, you should not use it in your own applications.

I’m angry again. I felt like I screwed up with WPSDAA password login system. Those PASSWORD() function I used from Visual QuickPro Guide book, and I believe they are making a bad choice to use PASSWORD() function in my login system application.

I have forced to shut down the WPSDAA login system, to avoid the problem from user logged in or else they might click 'forgot password' to get old & bad password, which it might get worse problem. I have been thinking and figuring out how to solve this damn problem from keeping users records to change the password without register needed.

Next to part two...

CSS vs. Tables

There is a good article about Stopdesign discussed their issue about tables vs. CSS layouts.

I held out for a long long time by using tables, but after seeing Stopdesign's article (relatively) reasonable argument on how efficient CSS layouts are, I’m forcing myself to make the move on.

One of the major compelling arguments of switching is that in Stopdesign’s CSS makeover example, the final redesigned page was nearly 1/3 the size of the original file, which, leads to a much faster page load. Additionally, editing your pages would simply involve changing a few proportions and directions in a CSS file instead of opening up your table-filled page - increasing productivity (and ridding yourself of headaches).

I have to pratice to use CSS layout design instead HTML tables. Thank god, in past of my freelance web work, I used CSS layout for WPSD Alumni Association (borrowed this from alistapart.com) and DeBee Communications (borrowed from SimpleBits).

Buggy Cookies

I created Alumni Association of Western Pennsylvania School for the Deaf website to use PHP and MySQL to make this programmable & function through register and login users.

I learned from the registered users frustrated with the login problem on their computer: The registered user sign their login to access the member’s web page, and he/she click into another member’s web page, and it kept bouncing back to login page, vice versia.

Thanks to Cathy Adams, WPSD Class of 1974 for active feedback through email about the login problem on her computer. I found what the problem caused:

Cookie.

I sent her a help instructions to solve this problem, and she chose Mozilla Firefox web browser and the login worked.

I found PHP.net to borrow their script forums: host browser accepts cookies in login page. I added the warning message will appear after login submitting w/ cookie disabled in the same page.

<?php

header("P3P: CP=\"ALL DSP COR NID CURa OUR STP PUR\""); 

$nocookies = false;
$reloaded = $_GET["ckset"];
$querystring = $_SERVER[QUERY_STRING];
$querystring = str_replace("ckset=ok", "", $querystring);

setcookie("check_cookie", "on", time()+(1000000));

if ($reloaded == "" and !isset($check_cookie)) {
   $nocookies = true;
   exit;
} else {
   if (!isset($check_cookie)) $nocookies = true;
}

If ($nocookies) {
   echo "Your browser is not accepting cookies. 
  Please turn them on or update your browser";
} else {
   echo "Your browser is accepting cookies";
}
?>
That’s it. Now, the registered users who have disabled cookies on their browser will receive the warning message and unable to log-in.

I learned my valuable experience with that kind of problem.

Web Design MEGA Reference

Web Design Resources is ultimate reference containing over three thousand links to information and articles about web design, with an emphasis on web standards and accessibility.   Includes:

- Accessibility
- Associations
- Books
- Cascading Style Sheets
- Color
- Dreamweaver
- Evaluation & Testing
- Events and conferences
- Flash
- Information Architecture
- JavaScript
- Misc.
- Navigation
- PHP
- Sites & Blogs
- Standards
- Tools
- Typography
- Usability
- XML
Awesome. This is definitely one of the best resource sites for the web developer. Bookmark it!

Via Zeldman.

Fun with CSS

CSS, short for Cascading Style Sheets. Webopedia defines, a new feature being added to HTML that gives both Web site developers and users more control over how pages are displayed. Here are some cool, unique and magical CSS sites:

CSS Creator – Select different CSS properties from the page on the browser, to select any display of color, look for the HTML tag you like to make this, and generate this into CSS code, copy and paste into your website.

Slants – It’s a hack. A trick. It is a way to make pure HTML and CSS draw something that is neither vertical nor horizontal. Do you want a slant of the heart?

Simple CSS rollover lists – This is rollover item or word to change color in background. JavaScript not required. All you can use simple CSS to make this text rollover!

CSS Validator – Validate your CSS code to find if there are no errors.

W3Schools CSS Tutorial – Learn CSS. Practice CSS. Take CSS quiz.

MT Drop Down Menu Codes

My friend, Justin asked me how to make the drop down menu for the selection of month or category archives which can be found on left side of my navigation, Archives. Here are the dirty codes:

Month Archives:
<select style="font-size:10px; font-family:Verdana, Arial, Helvetica, 
sans-serif;" onChange="document.location=options[selectedIndex].value">
<option>Select Month...</option>
<MTArchiveList archive_type="Monthly">
         <option value="<$MTArchiveLink$>"><$MTArchiveTitle$> - 
(<$MTArchiveCount$>)</option>
</MTArchiveList>
</select>

It should look like:

Category Archives:
<select style="font-size:10px; font-family:Verdana, Arial, Helvetica, 
sans-serif;" onChange="document.location=options[selectedIndex].value">
<option>Select Category...</option>
<MTArchiveList archive_type="Category">
<option value="<$MTArchiveLink$>"><$MTArchiveTitle$> - 
(<$MTArchiveCount$>)</option>
</MTArchiveList>
</select>

Yet, it should look like:

Reference via System.out.Blog, the girlie matters, and Movable Type User Manual.

My PHP's Random Images

You saw the random image above the daveynin's thing banner title image above and saw random photos in my main homepage.

How do I do that? I created PHP few lines to make image random. Here is the code:

<?
$lower = 1;    // set the starting number
$upper = 11;     // set the finishing number, total of images
$random_number = mt_rand($lower, $upper);  // random to pick a number
$image = "$random_number.jpg"; // convert into file name

echo "<img src='images/david_random/$image' alt='$image' border='0'">
?>

You need to place the images into directory path, and count the total of images, and insert the total of images in $upper variable.

If you don't have PHP, you can try this in JavaScript, it has more lines and work than I do. ;-)

W3 Schools

After I am done with Information Technology classes at Rochester Institute of Technology for my concentration: web developer / programming. Then, I feel there's something I need more: learning new stuff related to web progamming which never existed what I learned at Information Technology class courses. I find the interesting site, which I can learn myself from tutorial site, you can learn: HTML, XHTML, CSS, SQL, XML, XSL, DTD, JavaScript, DHMTL, and list goes on.

I enjoyed learning SQL tutorial for my first time and I took quiz for that after learning all SQL. I got 65% (13 out of 20 questions) on my first quiz. I also tried HTML and CSS quizzes without looking their tutorials. I got 80% and 85%.

1

Archives

What am I doing

    Tag cloud

    View All Tags

    SUBSCRIBE

    Powered by Movable Type 4.23-en