PHP Example
Screen shot
PHP Script to Validating data from Server Side.

<?php
if(isset($_POST['btnsubmit']))
{
if($_POST['userid']=="")
$userid_msg="Please Enter User ID";

if($_POST['password']=="")
$password_msg="Please Enter Password";
}
?>
<html>
<head>
<title>Validating data from Server Side</title>
</head>
<body>
<form name="frm" method="post" action="">
<table border="1">
<tr>
<td>User ID</td>
<td><input name="userid" type="text" />
<?php
if(isset($userid_msg) && $userid_msg!=="")
echo "<br>"."<font color='red'>".$userid_msg."</font>";
?>
</td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password" />
<?php
if(isset($password_msg) && $password_msg!=="")
echo "<br>"."<font color='red'>".$password_msg."</font>"."<br>";
?>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input name="btnsubmit" type="submit" value="submit" />
</td>
</tr>
</table>
</form>
</body>
</html>

You can download source code here