Tuesday, August 4, 2015

          Mail function in PHP 

               $to = "abc@a.com"; //email id to send

//Details for sending E-mail
$from = "from content";
$body  =  "Bharat swabhiman password recovery mail
-----------------------------------------------
<br/>
                           body    content <br/>
email : $to   ;
<br/>  ";
                $from = "admin@websitename.in"  ;
$subject = "Subject title of website"  ;
$headers1 = "From: $from\n" ;
$headers1 .= "Content-type: text/html;charset=iso-8859-1\r\n";
$headers1 .= "X-Priority: 1\r\n";
$headers1 .= "X-MSMail-Priority: High\r\n";
$headers1 .= "X-Mailer: Just My Server\r\n";
$sentmail = mail ( $to, $subject,$body, $headers1 );

Send Mail with help of PHP

Tuesday, December 2, 2014

I wish I had known these  tips the day I started working with PHP. Instead of learning them through painstaking process, I could have been on my way to becoming a PHP programmer even sooner! This article is presented in two parts and is intended for folks who are new to PHP.
Tip 1: MySQL Connection Class
The majority of web applications I've worked with over the past year have used some variation of this connection class:
class DB {
    function DB() {
        $this->host = "localhost"; // your host
        $this->db = "myDatabase"; // your database
        $this->user = "root"; // your username
        $this->pass = "mysql"; // your password
 
        $this->link = mysql_connect($this->host, $this->user,  
$this->pass);
        mysql_select_db($this->db);
    }
}
 
// calls it to action
$db = new $DB;
Simply edit the variables and include this in your files. This doesn't require any knowledge or special understanding to use. Once you've added it to your repertoire, you won't likely need to create a new connection class any time soon. Now you can get to work and quickly connect to your database without a lot of extra markup:
$result = mysql_query("SELECT * FROM table ORDER BY id ASC LIMIT 0,10");
More information can be found in the manual--be sure you read the comments: http://www.php.net/mysql_connect/
Tip 2: Dealing with Magic Quotes
PHP "automagically" can apply slashes to your $_POST data for security purposes. It's an important measure to prevent SQL injections. However, slashes in your scripts can wreak havoc. This is an easy method for dealing with them. The way to handle the slashes is to strip them from our variables. However, what if the magic quotes directive is not enabled?
function magicQuotes($post) {
 
        if (get_magic_quotes_gpc()) {
               if (is_array($post) {
                       return array_map('stripslashes',$post);
               } else {
                       return stripslashes($post);
               }
        } else {
               return; // magic quotes are not ON so we do nothing
        }
 
}
The script above checks to see if magic quotes is enabled. If they are, it will determine if your $_POST data is an array (which it likely is) and then it will strip the slashes accordingly.
Understand that this is not true 'validation'. Be sure to validate all your user-submitted data with regular expressions (which is the most common way to do so).
More information about magic quotes: http://www.php.net/ magic_quotes/
More information about SQL injection: http://www.php.net/manual/en/security.database.sql-injection.php/
More information about regular expressions: http://www.php.net/pcre/
Tip 3: Safely Query Database with mysql_real_escape_string
When you are ready to query your database you will need to escape special characters (quotes for instance) for safety's sake by adding slashes. We apply these before we insert variables into our database. Once again, we need to determine which version of PHP you are running first:
function escapeString($post) {
 
        if (phpversion() >= '4.3.0') {
               return array_map('mysql_real_escape_string',$post);
        } else {
               return array_map('mysql_escape_string',$post);               
        }
 
}
More information about mysql_real_escape_string: http://www.php.net/ mysql_real_escape_string/
More information about SQL injection: http://php.belnet.be/manual/en/security.database.sql- injection.php
Tip 4: Debugging
If you search the forum there are many good threads with rules about debugging. The single most important thing you can do is ask PHP to report errors and notices to you by adding this line at the beginning of your scripts:
error_reporting(E_ALL);
This will keep you in line as you learn by printing out errors to your screen. The most common error that E_ALL reports is not actually an error, but a notice for an "Undefined index". Typically, it means that you have not properly set your variable. It's easy to fix and keeps you programming correctly.
Another convenient tool while working with queries is print_r(). If your query is returning null or strange results, simply place this after your query command and it will display all the contents of the $result array.
print_r($result); exit;
The exit command stops your script from executing any further so you can specifically review your query results.
More information about error_reporting: http://www.php.net/ error_reporting/
More information about print_r; http://www.php.net/print_r/
Tip 5: Writing Functions (and Classes)
Initially I thought that tackling functions and classes would be difficult--thankfully I was wrong. Writing a function is something I urge all newbies to start doing immediately--it's really that simple. You are instantly involved in understanding how to produce more efficient code in smaller pieces. Where you might have a line of code that reads like this:
if ($rs['prefix'] == 1) {
        $prfx = 'Mrs. ';
} elseif ($rs['prefix'] == 2) {
        $prfx = 'Ms. ';
} else {
        $prfx = 'Mr. ';
}
 
echo $prfx.$rs['name'].' '.$rs['last_name'];
You could rewrite it like this in a function:
function makePrefix($prefix='')
{
        if (!$prefix) return '';
        if ($prefix == 1) return 'Mrs. ';
        if ($prefix == 2) return 'Ms. ';
        if ($prefix == 3) return 'Mr. ';
}
 
echo makePrefix($rs['prefix']) . $rs['name'] . ' ' . $rs['last_name'];
Now that you've written this function, you can use it in many different projects!
An easy way to describe classes is to think of it as a collection of functions that work together. Writing a good class requires an understanding of PHP 5's new OOP structure, but by writing functions you are well on your way to some of the greater powers of PHP.
More information about writing functions: http:// www.php.net/manual/en/language.functions.php
More information about writing classes: http:// www.php.net/manual/en/language.oop5.php
Everything I've learned, more or less, came from the manual, trial and error and great help from the many fine people here at PHPBuilder. Good luck programming--and come back soon for Part 2 in this series!


Tips That Every PHP Newbie Should Know

Thursday, May 22, 2014

There is given some useful programs such as factorial number, prime number, fibonacci series etc.



1) Program of factorial number.
class Operation{

 static int fact(int number){
  int f=1;
  for(int i=1;i<=number;i++){
  f=f*i;
  }
 return f;
 }

 public static void main(String args[]){
  int result=fact(5);
  System.out.println("Factorial of 5="+result);
 }
}

2) Program of fibonacci series.
class Fabnoci{

  public static void main(String...args)
  {
    int n=10,i,f0=1,f1=1,f2=0;
      for(i=1;i<=n;i++)
      {
        f2=f0+f1;
        f0=f1;
        f1=f2;
          f2=f0;
          System.out.println(f2);
      }
     
   }
 }

3) Program of armstrong number.
class ArmStrong{
  public static void main(String...args)
  {
    int n=153,c=0,a,d;
      d=n;
      while(n>0)
      {
      a=n%10;
      n=n/10;
      c=c+(a*a*a);
      }
      if(d==c)
      System.out.println("armstrong number");
      else
    System.out.println("it is not an armstrong number");
     
   }
}

4) Program of checking palindrome number.
class Palindrome
{
   public static void main( String...args)
  {
   int a=242;
   int  n=a,b=a,rev=0;
   while(n>0)
   {
     a=n%10;
     rev=rev*10+a;
     n=n/10;
   }
   if(rev==b)
   System.out.println("it is Palindrome");
   else
   System.out.println("it is not palinedrome");
 
  }
}

5) Program of swapping two numbers without using third variable.
class SwapTwoNumbers{
public static void main(String args[]){
int a=40,b=5;
a=a*b;
b=a/b;
a=a/b;

System.out.println("a= "+a);
System.out.println("b= "+b);

}
}

6) Program of factorial number by recursion
class FactRecursion{

static int fact(int n){
if(n==1)
return 1;

return n*=fact(n-1);
}

public static void main(String args[]){

int f=fact(5);
System.out.println(f);
}
}



Useful Programs of Core Java

Sunday, May 12, 2013


 Download Accelerator Plus (DAP) Premium 10.0.5.3 Full with Crack

http://softtogrow.blogspot.in/


Download Accelerator Plus (DAP) Premium Version 10.0.5.3 is one of the most used and favored Download Accelerator in the World because of its best features.Download accelerator provides you the maximum downloading speed as possible,also it is secure and convenient to use.Download accelerator plus supports resuming the downloads if the internet connection is dropped.It also increases the downloading speed about 400%.Download accelerator Plus now offers the SpeedBit Video accelerator which is best  for viewing videos smoothly without any buffering.

Features of Download Accelerator Plus (DAP)
  • Preview download for Audio and Video Files.
  • Provides an advanced information about the file and download source.
  • Conveniently manages your media files.
  • 400% increased downloading speed.
  • Resume paused and broken download links.
  • Advanced management for queries,priorities and Statuses.


Download Accelerator Plus (DAP) Premium 10.0.5.3 Full with Crack

Saturday, May 11, 2013

DAEMON Tools Ultra 1.0.0 Full Description



http://softtogrow.blogspot.in/





New DAEMON Tools solution that perfectly combines range of functions with user friendly interface. With DAEMON Tools Ultra you can mount not only image files but also virtual hard discs, while integrated iSCSI Initiator helps you to work with ODD and HDD. Main tools are now collected in friendly wizards for disс image creating, converting, burning etc. Now you don't have to think of creating and managing your virtual devices – just use Quik Mount option and start working with your Image Catalog. Уou can use key features of DAEMON Tools Pro but with even more comfort. DAEMON Tools Ultraenables you to create and mount VHD hard drives images. So you can easily access your data stored in VHD files. Now you can access remote CD/DVD or HDD devices, shared through iSCSI protocol. Choose available iSCSI target and mount it like a simple disc image. DAEMON Tools Ultra supports the most known types of iSCSI software and hardware targets DAEMON Tools new generation product which brings ultra facilities and ultra simplicity to the world of discs. Working with images never was so easy.
  
Requirements:
The lowest OS version required is Windows XP...

DAEMON Tools Ultra 1.0.0


CCleaner Pro 4.01.4093

 

http://softtogrow.blogspot.in/
DOWNLOAD CCleaner pro                                                                                                                  

CCleaner is the number-one tool for cleaning your Windows PC. 

Keep your privacy safe online, and make your computer faster and more secure. Over 500 million downloads!

CCleaner is a freeware system optimization, privacy and cleaning tool. It removes unused files from your system - allowing Windows to run faster and freeing up valuable hard disk space. It also cleans traces of your online activities such as your Internet history. Additionally it contains a fully featured registry cleaner. But the best part is that it's fast (normally taking less than a second to run) and contains NO Spyware or Adware! :)

Cleans the following:

* Internet Explorer
* Firefox
* Google Chrome
* Opera
* Safari
* Windows - Recycle Bin, Recent Documents, Temporary files and Log files.
* Registry cleaner
* Third-party applications
* 100% Spyware FREE

Features:

Cleans the following Windows components:

Internet Explorer
· Temporary File Cache
· URL History
· Cookies
· Hidden Index.dat files
· Last download file location

Firefox
· Temporary File Cache
· URL History
· Cookies
· Download manager
· Recycle Bin
· Clipboard
· Windows Temporary files
· Windows Log files
· Recent Documents (on the Start Menu)
· Run history (on the Start Menu)
· Windows XP Search Assistant history
· Windows XP old Prefetch data
· Windows memory dumps after crashes
· Chkdsk file fragments

Advanced Options allow cleaning of:

· Menu Order cache
· Tray Notifications Cache
· Window Size and Location Cache
· User Assist history
· IIS Log Files
· Custom Folders

· Application Cleaning:

As well as cleaning up old files and settings left by standard Windows components, CCleaner also cleans temporary files and recent file lists for many applications. Including: Firefox, Opera, Safari, Media Player, eMule, Kazaa, Google Toolbar, Netscape, Microsoft Office, Nero, Adobe Acrobat Reader, WinRAR, WinAce, WinZip and more...

· Registry Cleaning:

CCleaner uses an advanced Registry Cleaner to check for problems and inconsistencies. It can check the following:
· File Extensions
· ActiveX Controls
· ClassIDs
· ProgIDs
· Uninstallers
· Shared DLLs
· Fonts
· Help File references
· Application Paths
· Icons
· Invalid Shortcuts and more...

· Safety:
CCleaner was designed from the ground to be safe and secure to use. It has multiple levels of checks in place to ensure that it cannot delete any useful information or documents you may still need. We also certify that it contains no Spyware or Adware.

· High Security:
For the super cautious users we also offer secure file erasing. By overwriting the files before deleting them, making it impossible to recover the data.




DOWNLOAD CCleaner pro







CCleaner Pro 4.01.4093 Full Version Crack, Serial Key Free Download