Thursday, March 11, 2010
Message of the day
The computer programming language ADA was named in honor of Augusta Ada King. The U.S. Defense Department named the language after the Countess of Lovelace and daughter of Lord Byron because she helped finance and program what is thought to be the first computer, the “analytical engine” designed by Charles Babbage.
Sample PHP code for creating forgot password feature in any website
Find below the sample php code which can be used for implementing the forgot password feature.
The step involved are,
1. First provide a form with input text box with name "email" for allowing the user to enter his email id.
2. On submitting this form, the "email" will be posted to the php page mail-password.php.
3. From user table, query the password corresponding to the entered email id. (If you have stored the password in encrypted form then reset it with default/random password and send this default/random password to the user)
4. Validate the email id.
5. Prepare the email message and send it using php mail() function.
$email_to=$_POST['email'];
if ($email_to == "") // Email address cannot be empty
{
header("Location: mail-password.php?send=Email not entered");
}
else
{
if(is_valid_email($email_to)) // check the valid email address or not
{
$to=$email_to;
$subject="QualityPoint Password"; // Your subject
// From
$header = 'From: info@qualitypointtech.net' . "\r\n" .
'Reply-To: info@qualitypointtech.net' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
//add code for selecting $userid and $pass for user table for the input $email_to.
// Your message
$messages.="Forgot password - qualitypointtech.net \r\n";
$messages.="-------------------------------------- \r\n";
$messages.= "Your login information to our website is- \r\n";
$messages.="UserId: $userid \r\n";
$messages.="Password: $pass \r\n";
$messages.="-------------------------------------- \r\n";
// send email
$sentmail = mail($to,$subject,$messages,$header);
if($sentmail) //if your email succesfully sent
{
header("Location: mail-password.php?send=Password has been sent to your email id");
}
else // Cannot send password to your e-mail address
{
header("Location: mail-password.php?send=Not able to send email");
}
}
else //Email address has not been found in our database
{
header("Location: mail-password.php?send=Email address not found");
}
}
function is_valid_email( $address )
{
$rx = "^[a-z0-9\\_\\.\\-]+\\@[a-z0-9\\-]+\\.[a-z0-9\\_\\.\\-]+\\.?[a-z]{1,4}$";
return (preg_match("~".$rx."~i", $address));
}
The step involved are,
1. First provide a form with input text box with name "email" for allowing the user to enter his email id.
2. On submitting this form, the "email" will be posted to the php page mail-password.php.
3. From user table, query the password corresponding to the entered email id. (If you have stored the password in encrypted form then reset it with default/random password and send this default/random password to the user)
4. Validate the email id.
5. Prepare the email message and send it using php mail() function.
Wednesday, March 10, 2010
Welcome To Editorial Team Blog
It's been a pleasure having you all here. A common platform to share our views. Educate others what we learnt, about new technologies, skills. But nothing close to proprietory of BGT's nature.
Monday, March 8, 2010
Virtualization
Virtualization:
Virtualization is extending the computer so that it can run multiple os. For eg: We can run Linux on our Windows machine.
Uses of Virtualization:
one can run software written for one operating system on another(Even if the the real computer hardware is no longer supported by the virtual os)
After installation the virtual box is act as container, we can copy transport and back up between hosts.
One can save a particualr state and revert back.
It reduce the hardware and electricity costs.
Currently,Sun VirtualBox runs on the following host operating systems:
Windows hosts:
Windows XP, all service packs (32-bit)
Windows Server 2003 (32-bit)
Windows Vista (32-bit and 64-bit[1]).
Windows Server 2008 (32-bit and 64-bit)
Windows 7 (32-bit and 64-bit)
Mac OS X hosts:[2]
10.5 (Leopard, 32-bit)
10.6 (Snow Leopard, 32-bit and 64-bit)
Linux hosts (32-bit and 64-bit[3]). Among others, this includes:
Debian GNU/Linux 3.1 ("sarge"), 4.0 ("etch") and 5.0 ("lenny")
Fedora Core 4 to 11
Gentoo Linux
Redhat Enterprise Linux 4 and 5
Virtualization is extending the computer so that it can run multiple os. For eg: We can run Linux on our Windows machine.
Uses of Virtualization:
one can run software written for one operating system on another(Even if the the real computer hardware is no longer supported by the virtual os)
After installation the virtual box is act as container, we can copy transport and back up between hosts.
One can save a particualr state and revert back.
It reduce the hardware and electricity costs.
Currently,Sun VirtualBox runs on the following host operating systems:
Windows hosts:
Windows XP, all service packs (32-bit)
Windows Server 2003 (32-bit)
Windows Vista (32-bit and 64-bit[1]).
Windows Server 2008 (32-bit and 64-bit)
Windows 7 (32-bit and 64-bit)
Mac OS X hosts:[2]
10.5 (Leopard, 32-bit)
10.6 (Snow Leopard, 32-bit and 64-bit)
Linux hosts (32-bit and 64-bit[3]). Among others, this includes:
Debian GNU/Linux 3.1 ("sarge"), 4.0 ("etch") and 5.0 ("lenny")
Fedora Core 4 to 11
Gentoo Linux
Redhat Enterprise Linux 4 and 5
MESSAGE OF THE DAY
Computer-Virus
Virus Name: Elk Cloner
When: 1982
Created and Distributed on: Apple II computer
Creator: Richard Skrenta. 15-years-old boy.
Damage: Didn’t do any damage, but displayed only the following message:
Elk Cloner: The program with a personality
It will get on all your disks
It will infiltrate your chips
Yes it’s Cloner!
It will stick to you like glue
It will modify RAM too
Send in the Cloner!
Interesting facts
The first domain name registered is symbolics.com
Google makes changes small-and-often. They will sometimes trial a particular feature with a set of users from a given network subnet; for example Excite@Home users often get to see new features. They aren’t told of this, just presented with the new UI and observed how they use it.
Google makes changes small-and-often. They will sometimes trial a particular feature with a set of users from a given network subnet; for example Excite@Home users often get to see new features. They aren’t told of this, just presented with the new UI and observed how they use it.
Friday, March 5, 2010
An overview of Regular Expression
Regular expressions are a pattern matching standard for string parsing and replacement. They are used on a wide range of platforms and programming environment
Sample Eg:
Anchors:
^ Start of line
\A Start of String
$ End of Line
\Z End of String
\b Word boundary
\B Not word boundary
\< Start of Word
\> End of Word

Sample Eg:
| Regex | Matches |
|---|---|
| abc | abcabcabc |
| 234 | 12345 |
Anchors:
^ Start of line
\A Start of String
$ End of Line
\Z End of String
\b Word boundary
\B Not word boundary
\< Start of Word
\> End of Word

Subscribe to:
Posts (Atom)