HTML / CSS / JavaScript

Multi-User Web Phonebook

File hierarchy in Netbeans IDE
PHP Tutorial Hello World Application

Entity-Relationship Diagram
ERD Diagram Multi-User PhoneBook

 

phonebook.sql
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- Database: `phonebookDB`

CREATE TABLE IF NOT EXISTS `account` (
  `user_name` varchar(50) NOT NULL,
  `password` varchar(50) NOT NULL,
  PRIMARY KEY (`user_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE IF NOT EXISTS `profile` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(50) NOT NULL,
  `name` varchar(100) NOT NULL,
  `address` varchar(100) NOT NULL,
  `phone_number` varchar(50) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_name` (`user_name`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

ALTER TABLE `profile`
  ADD CONSTRAINT `profile_ibfk_1` FOREIGN KEY (`user_name`) REFERENCES `account` (`user_name`) ON DELETE CASCADE ON UPDATE CASCADE;
AddProfile.php
<?php
   session_start();

   include_once('../Bean/Profile.php');
   include_once('../DB/ProfileConn.php');

    if( isset($_SESSION['userName'])){
        $userName = $_SESSION['userName'];
        $name = $_POST['name'];
        $address = $_POST['address'];
        $phoneNumber = $_POST['phoneNumber'];
        //id set to zero since it is not used
        $profile = new Profile(0, $userName, $name, $address, $phoneNumber);
        $conn = new ProfileConn();
        $conn->Add($profile);
        header( 'Location: DisplayProfile.php' );
        
    } else{
        header( 'Location: ../index.html' ) ;   
    } 
?>

Joomla-like (Administrator) User Interface

I like the joomla's administrator user interface because of its cleanliness, so I decided to design an interface imitating it. It's pure CSS (cascading style sheet). Below is a screenshot of the said design.

joomla 1.5 user interface

Designing Field Error Message in Struts 2

The struts 2 tag <s:fielderror /> will generate the following html tags when field error occur (my example if for age and birthDate field):

Write Area - WYSIWYG HTML Editor

After upgrading from Ubuntu Karmic Koala to Lucyd Lynx, firefox was also upgraded. Its now version 3.6.3.  Firefox says Xinha is incompatible to its version. Im worried since it's my only wysiwyg html editor. Im planning to downgrade firefox. But before that, i tried searching a fiirefox add-on and look for wysiwyg.

Convert <textarea> field to WYSIWYG editor

If you already installed xinha, open a html page with a <textarea> field.
e.g.

Installing xinha (html WYSIWYG editor) in Firefox

Xinha is an open source html WYSIWYG editor replacement for <textarea> fields.
To install, follow the steps below.

Convert Source Code to HTML using vim

1. open your source code in vim
        go to Applications >>> Accessories >>> Terminal
        then type vim <codeFileName> then hit Enter
        e.g vim factorial.py
2. convert your code to readable html
       type :runtime! syntax/2html.vim then hit Enter

Remove Navigation Bar in Blogspot

Follow the following simple steps to remove the unwanted navigation bar in your blogspot blog.

Googlebot indexed my site!!!

My site is now searchable in Google search engine. I waited for two weeks after submitting my url, and now my site was indexed regularly by Googlebot--the search bot software used by google. Im waiting for Yahoo to approve my site.

google search engine

Syndicate content