Jun 18, 2012

Web Applications Development


For beginners of Web development,my biggest advice is to understand HTML and once you think you're done with html basics,move on to other wings of CSS,PHP etc.Here I would like to share my experiences with web development and the journey which I think will help any beginner in Web development to land successfully int their projects.

Two years before, I was wondering how are the web applications been build and maintained ! Then I began to start from its basic element -HTML. Of course to get a good grip on any web designed application , you need to be good at HTML.So I understood the basics tag elements, implementation of forms, styling and table features in HTML. The base at HTML will certainly will contribute towards your progress in CSS. A sound knowledge in CSS is helpful in designing your own outline in web designing. The concepts of div and customizing the elements, will lead to custom outline design of web page.  

To advance in dynamic environment of web page, better to know javascript. The functionality feature along with hidden code feature, helps to develop a very good application platform. The form validity feature is the functionality i really liked in javascript. So now once you come through HTML, CSS, JavaScript- i would say you have paved your platform for web applications.

Now to go a step ahead is the wonderful language of PHP. Php acts as a link between your application and and data storage.MySql comes handy once you look for a back end support. Acting as a base, mysql extends the feature to create tables,alter it,update it and many more features which helps in data storage. The basic things to learn in mysql are to design- how to create tables,adding constraints,insert into table, updating tables, retrieving the contents from table based on view and constraints.

Now php supports html inside it .Its really easy to embed html inside a php page.Just put ur each lines of html into a  echo ""  statement.

So easy I guess to change your html page to php page. Now like javascript , php helps in  hiding the code content from being viewed. So it offers security compared to html.Also Php helps to add queries to its page, which helps in acting as a interface between application and tables of mysql platform and helps in transfer of data.

Below is a basic php code of how to connect to sql and retrieve contents from it , verify and step ahead.The code basically connects with mysql, retrieves data and thus takes action on basis of it.



php
$conn=mysql_connect("localhost","root","pwd");//enter password of mysql instead of pwd
if(!$conn)
{
die('COUDNOT CONNECT SUCCESSFULLY:'.mysql_error());
}
mysql_select_db("dbname",$conn);
$query="SELECT * FROM ACCOUNT WHERE USER='abc' AND PASS='passed' ";
$res1=mysql_query($query,$conn);
$num1=mysql_num_rows($res1);//retrieves number of available tuples corresponding to query

if($num1 != null)
{
}

mysql_close($rohi);
?>


Similarly i would suggest to learn the basic php code of Inserting the contents into table , displaying the contents of a table , which will help you to achieve almost 80% of your tasks in PHP.The basic starting of all these features will be same as above.

So now for people loving Java and JSP, I would suggest all the steps you followed in PHP is equally applicable in java too.Also for lovers of Oracle,SQL, and M' Access , the contents I mentioned about MySql is equally applicable.

For Java the code for connectivity will differ as the example given below:

import java.sql.*;
import javax.sql.*;

class DBConn
{
public static void main(String args[])
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection conn=DriverManager.getConnection("jdbc:odbc:db_pwd");//
//code for inserting contents
PreparedStatement ps=conn.prepareStatement("insert into ACCOUNT values(?,?,?)");
ps.setString(1,"abc");
ps.setString(2,"pass");
ps.setInt(3,100);

System.out.println("Rows Inserted"+ps.executeUpdate());


//code to retrieve contents
Statement stm=conn.createStatement();
ResultSet rs=stm.executeQuery("select * from stud");

while(rs.next())
{
System.out.println(rs.getString(1));
System.out.println(rs.getString(2));
System.out.println(rs.getInt(3));
}
}catch(SQLException e)
{
System.out.println("Exception" +e);
}
catch (ClassNotFoundException cnfe){
System.out.println("" + cnfe);
}

}
} 

Now using jsp, we can integrate HTML,CSS along with Java for advanced features.Same like php, here to embed HTML into JSP, we just need to embed html into a statement called  out.println();

Similarly the concept of Servlets helps in modularizing the components. So you can take PHP of JSP as the front end of your projects and build on its appearance and functionalities. Meanwhile we can fix mysql/oracle/Ms Access as back end and work on how data are normalized into tables and adding constraints properly to maintain data security.

To begin with basic web development, its very easy once you think you've got enough basics of HTML.For me, HTML have lead me to a point of confidence and passion to learn the other parts of Web applications. I would personally suggest sites like w3schools will definitely help any one in web application development field

Some of the common workable web application projects include student-management system,hospital management system, event managements systems etc.

Anybody who have queries on above contents do post your queries and I'll try my level best to answer your queries.

Jun 13, 2012

How can i check intrusion into my system using firewalls?


I was recently shocked to find that I had downloaded a huge heap of data on a single day as reported by my college authorities. I checked my update history, checked my system updates , but still I could only found was just MB size. So how did i downloaded  GB sizes from net???

The very next day, I found one of my other classmate too reporting to have downloaded huge sized data from same wifi. Now I began to think of some intruder being outplaying us.

This made me look into the deeper side of intrusion. I heard from many that there is been a concept called Nmapping, where  your ports and even MAC can be spoofed by others. This was a shocking fact for me. It was then very easy for me to think how would have an intruder peeped into my system.But the most fascinating thing I interested  to know was 'how would have INTRUDER done so??? '.

First thing I did was to install a firewall to observe the activities within my system.I downloaded  and set a firewall. As soon as I activated the security, things were coming in my way. I found there had been a software called Port Locker, which was installed in my laptop recently, and it have been blocked my firewall.  Further I detected some 179 intrusions in next one hour !!

The intrusion attempt went to almost 600 around next 3 hours. Then I observed the details of target of intrusion.I found all these were targeted to some folder called port Locker.I was little bit concerned about the issue and approached college authorities.They thoroughly checked system and found that there had been a malicious software called as 'hotspot', which in turns sucks the entire band width of wifi and can be manipulated very easily.So GB size can never be an issue.

Looking into wikipedia, i understood of what hotspot is  "A 'poisoned/rogue hotspot' refers to a free public hotspot set up by identity thieves or other malicious individuals for the purpose of "sniffing" the data sent by the user. Such identity thieves will have access to the MAC address of the connecting terminal, which individually identifies the hardware. By examining packets sent, they may attempt to decipher passwords, login names, or other sensitive information."

Further due to thorough analysis, i found lots of unwanted applications and add-ons like yontoo, which was detected as suspicious by my anti-virus. It took a good change on my system and its performance after most of these applications were once removed.

So be aware of such identity thieves around you,even in your same LAN/Wifi and do try the level best to get rid of issues like this. What i found myself to be secure afterwards was,having a good firewall and mechanism to detect the intrusions will always give you an upper hand in being betrayed by these poisoned hotspots in your personal computer/laptops.