i'm PHP Programmer and i'm Here to Help PHP developers with php coding




Delete with checkbox in PHP

<?php
$host
="localhost"// Host name$username=""// Mysql username$password=""// Mysql password$db_name="test"// Database name$tbl_name="test_mysql"// Table name

// Connect to server and select databse.
mysql_connect("$host""$username""$password")or die("cannot connect");mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name";$result=mysql_query($sql);
$count=mysql_num_rows($result);
?><table width="400" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><form name="form1" method="post" action="">
<table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#FFFFFF">&nbsp;</td>
<td colspan="4" bgcolor="#FFFFFF"><strong>Delete multiple rows in mysql</strong> </td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF">#</td>
<td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>Name</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>Lastname</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>Email</strong></td>
</tr>
<?phpwhile($rows=mysql_fetch_array($result)){?><tr>
<td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>"></td>
<td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['name']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['lastname']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['email']; ?></td>
</tr>
<?php}?><tr>
<td colspan="5" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td>
</tr>
<?php// Check if delete button active, start thisif($_REQUEST['delete']){
for(
$i=0;$i<$count;$i++){$del_id $checkbox[$i];$sql "DELETE FROM $tbl_name WHERE id='$del_id'";$result mysql_query($sql);
}

echo 
$_REQUEST['delete'];
die(
' - Died');

// if successful redirect to delete_multiple.phpif($result){
echo 
"<meta http-equiv=\"refresh\" content=\"0;URL=delete_multiple.php\">";
}
}
mysql_close();?></table>
</form>
</td>
</tr>
</table>


Read more...

Expert PHP programmers bring revolution in your business


xpert PHP programmer can harness maximum benefits from this open source web programming language PHP. When the matter is of web development, offshore PHP development companies choose PHP over other programming language as it has great functionality that make development easy and speedy. PHP is based on HTML and PHP programmer ought to know XML. PHP being very old programming language, the learning curve for developers is less. Offshore PHP development firms are extremely popular for their best development services and cost-effectiveness. PHP is a server-side technology and being open source there is no licensing fee involved.

An experienced PHP Programmer would certainly supply beneficial methods for development of compelling internet sites hence making websites more user-friendly and entertaining. A lively website developed by such efforts would mean tempting more traffic in order to get splendid returns. Most commonly, the PHP programmers are capable to create CMS which usually allow an individual to create, revise and also erase a precise website page online. A good PHP developer is aware of both - client necessities and his own capabilities. Therefore, he knows the way to employ them and best time to deliver it.

These days offshore PHP development centers are extremely popular in the global software outsourcing market. There are several reasons behind this powerful demand of PHP development services which includes:

  1. Low development cost and speedy development. The saved money can be use for business development.
  2. Automation of business processes
  3. MYSQL as a database with the PHP application can store unlimited data and accessing those information is as easy as click-on.

When you hire PHP programmers from the offshore development centers there are certain characteristics ought to be checked and it includes: Expertise in website development and integration with CRM and CMS, web-designing, ecommerce application development,rich internet application development and development of social networking sites.

PHP coding is most popular among the web developers and there are several reasons behind this. Major reason is its open source nature which significantly help developers to learn PHP programming from the expert and experienced PHP programmers. Any developer new to PHP can become part of this biggest online software community and upgrade their knowledge. Being a part of such online community doesn't need any investment instead developer can learn so many new things and create revolutionary websites. All what he/she requires is a basic information of JAVA and Perl. Most of the CMS are developed using PHP framework which shows how easy it is for developers to code in PHP.

It is always essential to employ the service of qualified PHP programmer to take advantage of the deep and intricate understanding of the PHP systems in order to have an correctly individualized Content management systems. PHP is simple to implement, decreases cost plus lessens time required to development projects. As PHP is open source application, it is possible for best PHP programmers to get constantly refreshed with the ground breaking purposes built about the platform across the globe. Hence, PHP programmers are really a happy lot to work with when it comes to building compelling websites.


Read more...

PHP Web Development Part 2


Read more...

Hire best PHP programmers to enhance business operations


PHP developer makes use of PHP language which is an open source for all and is based on HTML language. Best PHP programmers enjoy PHP coding as it has distinct feature set and offers great flexibility to developers. PHP programmers with the help of PHP open source code can bring loyalty in their relationship with clients and provide 100% satisfaction to them. Offshore PHP development is becoming more and more popular these days. There are other web programming languages to develop web solutions but PHP is the most popular among all. PHP is considered as a replacement of ASP. NET framework. Experience PHP programmer from offshore PHP development companies have knowledge of MySQL, JAVA, VB and XML.

Perhaps the most common PHP Programmer would certainly deliver successful solutions for development of dynamic web sites hence making websites way more user-friendly and interactive. A lively website developed by such efforts would mean appealing to a boost in traffic in order to be converted into loaded returns. Largely, the PHP programmers are capable to develop content management system which in turn enable a person to create, change as well as erase a unique web page over the internet. A good PHP Programmer recognizes both equally - customer demands and the own skill sets. And also, for that reason, they know the way and time to implement them.

Below are the benefits of hiring PHP development services:

  1. PHP being an open source language drastically reduces the web development cost. Particularly when businesses hire offshore PHP development firms, the development cost is reduced by 70% and this saved amount can be used for the further expansion of businesses.
  2. Web application developed using PHP automate the business processes and makes them easy to operate. Accessing and sharing any information within organization becomes easy and quick.
  3. PHP application use MYSQL as a database system thus organization can store data of any size and enhance their performance in the market.

Moreover, there are several essential things that PHP programmer requires. They should have expertise in website Integration, website maintenance & enhancement, website designing & development, customized e-Commerce development services, social network applications, multimedia applications, content management system development & integration.

Open source community is the largest programming community in the world. PHP being a part of this open source community gives tremendous opportunities to PHP programmers to turn into best PHP programmers. There are many forums and websites available on internet which helps fresher PHP programmers to get expert's skill. All content management systems are developed using PHP with MYSQL as a database. Anyone with the sound knowledge of above framework can provide personalized web solutions to their clients.

Given this track record, it is still vital to hire skilled PHP developers to get the profound and elaborate familiarity with the PHP platforms or even come with an appropriately customized Content management systems. PHP is simple to use, lowers cost and also minimizes time necessary to develop projects. Due to the open source nature, it's possible for best PHP developers to be constantly refreshed with the revolutionary applications designed on the platform throughout the world. Hence, PHP developers enjoy to work with PHP and create powerful websites.


Read more...

PHP & MySQL Web Development - Part 1


Read more...

Employing Indian PHP developers will ensure excellent web solutions


PHP is one of the web programming language which is used to develop web application, desktop application or mobile applications. It is also an open source framework thus no licensing fee is involved and development becomes cost-effective. PHP is one of the most popular web programming language existing in the market. PHP being one of the oldest programming language, the learning curve is significantly less compared to other programming language available in the industry today. PHP is a reliable and user-friendly platform. Businesses in need of PHP developer have located India as the best offshore PHPdevelopment center.

Indian PHP developers are booming these days for their IT outsourcing services. eTatvasoft is one of the leading PHP development company in India. Indian PHP developers provide best web development solution in most competitive rates. PHP designers from eTatvasoft have experience and expertise both in providing customized solution to clients of various industries and various countries. Global businesses are extremely benefited by hiring offshore PHP development services from India. These offshore firms like eTatvasoft allow their clients to rent PHP developers or designers on hourly or weekly basis. Businesses may also pay them based on project or can make monthly payment. PHP designers from eTatvasoft are well versed with the latest technology and have excellent command on English thus establishing communication with Indian PHP developers is quite easy for global clients.

PHP programmers from eTatvasoft are provided on the job training and all necessary resources from the company they are working with. They are also trained for the professionalism in their communication and work. PHP programmers from Indian web development firms excel in developing content management system and customer relationship management modules. Hiring experience and talented PHP programmers for their project can help businesses increase their revenues. The reputed and renowned Indian PHP development firms like eTatvasoft report regularly to client regarding project development which leads to 100% client satisfaction and long lasting corporate relationship. These offshore firms use online tool like email, chat, or any personalized communication tool. They're also known for timely completion of project. Outsourcing PHP development from India can help you save 50% of amount from your estimated budget.


Read more...

All time Best CSS3 Code Generators

Here are some Great Collection for CSS3 Code Generators Hope you will get maximum Help from this Post 




Have I missed your favorite CSS3 code generator?  if so you can post them in comments thanks


Read more...

Beginners Guide for Php Development

Nice Book I found For beginners

Beginners Guide for Php Development with MVC Architecture

Beginner's Guide to PHP Development with MVC Architecture Beginners Guide for Php Development with MVC Architecture


Read more...

Simple Usage for Mysql With Object Oriented Style......

Found This Simple Usage for Mysql With Object Oriented Style......From Facebook

<?php

/**
* mysqllib.php
* A Simple Usage of Mysql with
* Object Oriented Style
* Written Just For Manage The
* Functions Easly And Make the Funny
* The Connection :)
* */


/******************************
* Main Structure Of Library.. *
*******************************/


class MysqlLib
{
/**
* $Link : For Connection to Server
* with mysql_connect() function
* @access Public
* */

Public $Link;

/**
* $Dblink : Connection to Database
* with mysql_select_db() function
* @access Public
* */

Public $DbLink;

/**
* $SqlLink : For mysql_query() unction
* @access Public
* */

Public $SqlLink;

/**
* $NumRow: Getting Num Rows of Last Result
* or Last Query
* @access Public
* */

Public $NumRow;

/**
* $Error : for mysql_error()
* @access Public
* */

Public $Error;

/**
* $ErrNo : get the error code of last query
* @access Public
* */

Public $ErrNo;

/**
* $Assocative : for get mysql_fetch_assoc() function
* @access Public
* */

Public $Assocative;

/**
* Constructionof Class
* $host : mysql server name
* $user : mysql access username
* $pass : mysql access password
* $db : your database
* */

function __construct($host,$user,$pass,$db)
{
$this->host = $host;
$this->user = $user;
$this->pass = $pass;
$this->dbnm = $db;
}

/**
* Gets the Host name By the __construct function
* @access Public
* @return Bool
* */

Public Function getHost()
{
return $this->host;
}

/**
* Gets the username By the __construct function
* @access Public
* @return String
* */

Public Function getUser()
{
return $this->user;
}

/**
* Gets the password By the __construct function
* @access Public
* @return String
* */

Public Function getPass()
{
return $this->pass;
}

/**
* Gets the Database By the __construct function
* @access Public
* @return String
* */

Public Function getDb()
{
return $this->dbnm;
}

/**
* Make connection For Server And Database
* @access Public
* @return Bool
* */

Public Function init()
{
$this->Link = mysql_connect($this->getHost(),$this->getUser(),$this->getPass()) or die(mysql_error());
$this->DbLink = mysql_select_db($this->getDb(),$this->Link) or die(mysql_error());
}

/**
* Sends the Sql Query to Server
* @access Public
* @return Bool
* */

Public Function initSql($sql)
{
$this->SqlLink = mysql_query($sql) or die(mysql_error());

return $this->SqlLink;

}

/**
* Gets Affected Num Rows By the Last Query
* @access Public
* @return Int
* */

Public Function getNumRow()
{
$this->NumRow = mysql_num_rows($this->SqlLink) or die(mysql_error());

return $this->NumRow;

}

/**
* Gets All Given Data to assocative Array
* @access Public
* @return String
* */

Public Function FetchAssoc()
{
$this->Assocative = mysql_fetch_assoc($this->SqlLink) or die(mysql_error());

return $this->Assocative;
}

/**
* Gets The Last error
* @access Public
* @return String
* */

Public Function getError()
{
$this->Error = mysql_error();

return $this->Error;
}

/**
* Gets the Error Code of Last operation
* @access Public
* @return Int
* */

Public Function getErrorNo()
{
$this->ErrNo = mysql_errno();

return $this->ErrNo;
}

}

?>




Read more...

Control structure condition statement(if,else if,else, switch case)example in PHP programming language


<html> <head> <title>Untitled Document</title> </head> <body>
<form method="get" action="<? $_SERVER["PHP_SELF"] ?>"/>
Your qualification: <input name="saje" type="radio" value="DEGREE" checked="checked" /> degree
<input name="saje" type="radio" value="MASTER" /> master Your salary
<select name="salary"> <option value="" selected="selected">please select</option> <option value="1">BELOW RM1000 </option> <option value="2">RM1000 TO RM2000</option> <option value="3">RM2000 TO RM3000</option> <option value="4">ABOVE RM3000</option> </select>
<input type="submit" value="PROCEEDAA">
</form>

<?
echo " ";
echo "KELULUSAN HANG:".$_REQUEST['saje'];
echo " ";
$salary = $_REQUEST['salary'];


if($salary=="1") { echo "gaji hang below RM1000"; }
else if($salary=="2") { echo "gaji hang antara RM1000 ke RM2000"; }
else if($salary=="3") { echo "gaji hang antara RM2000 ke RM3000"; }
else if($salary=="4") { echo "gaji hang atas RM4000"; }
else { echo "Hang tak pilih gaji";} echo " ";

switch($salary) {

case "1":
echo "gaji hang below RM1000";
break;

case "2":
echo "gaji hang antara RM1000 ke RM2000";
break;

case "3":
echo "gaji hang antara RM2000 ke RM3000";
break;

case "4":
echo "gaji hang atas RM4000";
break;

default: echo "Hang tak pilih gaji";
} ?>
</body> </html>


Read more...

The following XHTML rules differentiate it from HTML:

i found this in part of the book of php mysql & javascript
The following XHTML rules differentiate it from HTML:
• All tags must be closed by another tag. In cases in which there is no matching
closing tag, the tag must close itself using a space followed by the symbols / and
>. So, for example, a tag such as <input type='submit'> needs to be changed into
<input type='submit' />. In addition, all opening <p> tags now require a closing
</p> tag, too. And no, you can’t replace them with <p />.
• All tags must be correctly nested. Therefore the string <b>My first name is
<i>Robin</b></i> is not allowed, because the opening <b> has been closed before
the <i>. The corrected version is <b>My first name is <i>Robin</i></b>.



• All tag attributes must be enclosed in quotation marks. Instead of using tags
such as <form method=post action=post.php> you should instead use
<form method='post' action='post.php'>. You can also use double quotes:
<form method="post" action="post.php">.
• The ampersand (&) character cannot be used on its own. For example, the string
“Batman & Robin” must be replaced with “Batman &amp; Robin”. This means
that URLs require modification, too. So the HTML syntax <a href="index.php?
page=12&item=15"> should be replaced with <a href="index.php?
page=12&amp;item=15">.
• XHTML tags are case-sensitive and must be all in lowercase. Therefore HTML
such as <BODY><DIV ID="heading"> must be changed to the following syntax:
<body><div id="heading">.
• Attributes cannot be minimized any more, so tags such as <option name="bill"
selected> now must be replaced with an assigned value: <option name="bill"
selected="selected">. All other attributes such as checked and disabled also need
to be changed to checked="checked", disabled="disabled", and so on.
• XHTML documents must start with a new XML declaration on the very first line,
like this: <?xml version="1.0" encoding="UTF-8"?>.
• The DOCTYPE declaration has been changed.
• The <html> tag now requires an xmlns attribute.


Read more...

Basic DB Search Script

PHP Tutorial With MYSQL Coding
<?php
/**
 * @author Bradley Weston <admin@webod.co.uk>
 */


if(version_compare(PHP_VERSION, 5, '<'))
    die("Please upgrade your PHP.");
if(!class_exists('mysqli'))
    die("Please install Mysqli extention.");


class DB_Search {

    protected $DB = NULL;
    protected $Keywords = NULL;
    protected $searchTable = NULL;
    protected $searchColumns = NULL;
    protected $lastSearchResult = NULL;

    function __construct (){
        $this->Keywords = array();
        $this->searchColumns = array();
    }

    function setSearchTable ($Tablename){
        $this->searchTable = $Tablename;
    }

    function addSearchColumn ($Columnname){
        $this->searchColumns[] = $Columnname;
    }

    function DB_Connect ($Hostname, $Username, $Password, $Name, $Port = 3306){
        $this->DB = new mysqli(
            $Hostname,
            $Username,
            $Password,
            $Name,
            $Port
        );
    }




    function DB_Connect_Resource (mysqli &$Connection){
        $this->DB = $Connection;
    }

    function addKeyword ($Keyword){
        $this->Keywords[] = $Keyword;
    }

    function parseString ($String){
        array_map(array($this, 'addKeyword'), explode(' ', $String));
    }

    protected function query (){
        //You may want to make this query more percific to get exact results first
        //this is just a basic search for keywords
        $Q = '';
        foreach($this->searchColumns as $Column){
            foreach($this->Keywords as $Keyword){
                $Q .= sprintf("`%s` = '%s' ", $Column, $Keyword);
            }
        }
        $this->lastSearchResult = $this->DB->query(sprintf(
            "SELECT * FROM `%s` WHERE %s",
            $this->searchTable,
            $Q
        ));
    }

    function getResult (){
        if(!is_a($this->lastSearchResult, 'mysqli_result')) $this->query();
        $Result = $this->lastSearchResult->fetch_assoc();
        if($Result == NULL) return false;
        return $Result;
    }

}


//USAGE


$MyGlobalDBConnection = new mysqli('localhost', 'root', 'abcd1234', 'testdb');


$Search = new DB_Search;
$Search->DB_Connect_Resource($MyGlobalDBConnection);
$Search->setSearchTable('mytesttable');
$Search->addSearchColumn('keywords');
$Search->addSearchColumn('description');
$Search->addSearchColumn('product_name');


$Search->parseString('my test string');


while(false !== ($Result = $Search->getResult())){
    print_r($Result);
}







Read more...

CHAT BOX Ajax-PHP without Database

PHP Help 
CHAT BOX Ajax-PHP without Database

FILE 1 : index.php
<?php
session_start();

function createForm(){
?>
      <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
        <table align="center">
          <tr><td colspan="2">Please eneter a nickname to login!</td></tr>
          <tr><td>Your name: </td>
          <td><input class="text" type="text" name="name" /></td></tr>
          <tr><td colspan="2" align="center">
             <input class="text" type="submit" name="submitBtn" value="Login" />
          </td></tr>
        </table>
      </form>
<?php
}



if (isset($_GET['u'])){
   unset($_SESSION['nickname']);
}

// Process login info
if (isset($_POST['submitBtn'])){
      $name    = isset($_POST['name']) ? $_POST['name'] : "Unnamed";
      $_SESSION['nickname'] = $name;
}

$nickname = isset($_SESSION['nickname']) ? $_SESSION['nickname'] : "Hidden";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
   <title>Micro Chat AJAX-PHP</title>
   <link href="style/style.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
    <!--
      var httpObject = null;
      var link = "";
      var timerID = 0;
      var nickName = "<?php echo $nickname; ?>";

      // Get the HTTP Object
      function getHTTPObject(){
         if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
         else if (window.XMLHttpRequest) return new XMLHttpRequest();
         else {
            alert("Your browser does not support AJAX.");
            return null;
         }
      }

      // Change the value of the outputText field
      function setOutput(){
         if(httpObject.readyState == 4){
            var response = httpObject.responseText;
            var objDiv = document.getElementById("result");
            objDiv.innerHTML += response;
            objDiv.scrollTop = objDiv.scrollHeight;
            var inpObj = document.getElementById("msg");
            inpObj.value = "";
            inpObj.focus();
         }
      }

      // Change the value of the outputText field
      function setAll(){
         if(httpObject.readyState == 4){
            var response = httpObject.responseText;
            var objDiv = document.getElementById("result");
            objDiv.innerHTML = response;
            objDiv.scrollTop = objDiv.scrollHeight;
         }
      }

      // Implement business logic 
      function doWork(){ 
         httpObject = getHTTPObject();
         if (httpObject != null) {
            link = "message.php?nick="+nickName+"&msg="+document.getElementById('msg').value;
            httpObject.open("GET", link , true);
            httpObject.onreadystatechange = setOutput;
            httpObject.send(null);
         }
      }

      // Implement business logic 
      function doReload(){ 
         httpObject = getHTTPObject();
         var randomnumber=Math.floor(Math.random()*10000);
         if (httpObject != null) {
            link = "message.php?all=1&rnd="+randomnumber;
            httpObject.open("GET", link , true);
            httpObject.onreadystatechange = setAll;
            httpObject.send(null);
         }
      }

      function UpdateTimer() {
         doReload();
         timerID = setTimeout("UpdateTimer()", 5000);
      }


      function keypressed(e){
         if(e.keyCode=='13'){
            doWork();
         }
      }
    //-->
    </script>
</head>
<body onload="UpdateTimer();">
    <div id="main">
      <div id="caption">Micro Chat</div>
      <div id="icon">&nbsp;</div>
<?php

if (!isset($_SESSION['nickname']) ){
    createForm();
} else  {
      $name    = isset($_POST['name']) ? $_POST['name'] : "Unnamed";
      $_SESSION['nickname'] = $name;
    ?>

     <div id="result">
     <?php
        $data = file("msg.html");
        foreach ($data as $line) {
                echo $line;
        }
     ?>
      </div>
      <div id="sender" onkeyup="keypressed(event);">
         Your message: <input type="text" name="msg" size="30" id="msg" />
         <button onclick="doWork();">Send</button>
      </div>
<?php         
    }

?>
    </div>
</body>  FILE 2 : message.php
 <?php
                if (isset($_GET['msg'])){
                                if (file_exists('msg.html')) {
                                   $f = fopen('msg.html',"a+");
                                } else {
                                   $f = fopen('msg.html',"w+");
                                }
      $nick = isset($_GET['nick']) ? $_GET['nick'] : "Hidden";
      $msg  = isset($_GET['msg']) ? htmlspecialchars($_GET['msg']) : ".";
      $line = "<p><span class=\"name\">$nick: </span><span class=\"txt\">$msg</span></p>";
                                fwrite($f,$line."\r\n");
                                fclose($f);

                                echo $line;

                } else if (isset($_GET['all'])) {
                   $flag = file('msg.html');
                   $content = "";
                   foreach ($flag as $value) {
                                $content .= $value;
                   }
                   echo $content;

                }
?>FILE 3: msg.htmlnotes ! this is file empty!


Read more...