A Databse Handling Class In Php

Now this is the age of RAD (Rapid App Development Tool). To run faster in web development thins class may help you. This is simply a DBHANDLER class .

We suggest you to use the DBHANDLER Class and find its amazing potential in the modern age that is primarily governed by Rapid Application Development Tools.

class __dbConfigSys

{

var $LINK=”; var $NON=’DD’;

var $HOST=”; var $USER=”; var $PASS=”; var $DB=”;

var $ERROR=”;

function  __dbConfigSys($DBHOST,$DBUSER,$DBPASS,$DBNAME) {

$this->HOST=$DBHOST; $this->USER=$DBUSER; $this->PASS=$DBPASS; $this->DB=$DBNAME;

}

function mySQLConnet() {

$LINK= @mysql_pconnect($this->HOST,$this->USER,$this->PASS,65536);

if(!$LINK) {

$this->ERROR['MYSQL_PCONNECT']=’LINE 12 :’ . mysql_error() . ‘ . [mySQLConnet]‘;

return 0;

} else {

$this->LINK=$LINK;

$SELDB=@mysql_select_db($this->DB,$LINK);

if(!$SELDB) {

$this->ERROR['MYSQL_SELECT_DB']=’LINE 18 :’ . mysql_error() . ‘ . [mySQLConnet]‘;

return -1;

} else {

return $SELDB;

}

}

}

function executeNonQuery($QUARY) {

if($QUARY==”) {

$this->ERROR['QUARY_NULL']=’LINE 28 : NO QUERY SENT IN THE FUNCTION [executeNonQuery]‘;

return 0;

} else {

$this->mySQLConnet();

$SELDB=@mysql_query($QUARY);

if(!$SELDB) {

$this->ERROR['MYSQL_QUARY']=’LINE 34 : PLEASE CHECK THE QUERY [ ' . $QUARY . ' ]. ‘ . mysql_error() . ‘ . [executeNonQuery]‘;

} else {

mysql_close($this->LINK);

return 1;

}

}

}

function resultSET($QUARY) {

if($QUARY==”) {

$this->ERROR['QUARY_NULL']=’LINE 44 : NO QUERY SENT IN THE FUNCTION [executeNonQuery]‘;

return 0;

} else {

$this->mySQLConnet();

$SELDB=mysql_query($QUARY);

if(!$SELDB) {

$this->ERROR['QUARY_ERROR']=’LINE 50 : PLEASE CHECK THE QUERY [ ' . $QUARY . ' ]. ‘ . mysql_error() . ‘ . [resultSET]‘;

} else {

while($RESULTSET=mysql_fetch_array($SELDB)) {

$RECORDSET[]=$RESULTSET;

}

mysql_close($this->LINK);

return $RECORDSET;

}

}

}

function noofRECORDS($QUARY) {

if($QUARY==”) {

$this->ERROR['QUARY_NULL']=’LINE 44 : NO QUERY SENT IN THE FUNCTION [executeNonQuery]‘;

return 0;

} else {

$this->mySQLConnet();

$SELDB=@mysql_query($QUARY);

if(!$SELDB) {

$this->ERROR['QUARY_ERROR']=’LINE 50 : PLEASE CHECK THE QUERY [ ' . $QUARY . ' ]. ‘ . mysql_error() . ‘ . [resultSET]‘;

} else {

return @mysql_num_rows($SELDB);

}

}

}

function lastID() {

$this->mySQLConnet();

return mysql_insert_id();

}

function __debug() {

$MSG=’<div style=”margin-top:10px margin-buttom:10px; border:1px dashed #000000; background-color:#d8d8d8;”><ul>’;

if($this->ERROR!=”) {

foreach($this->ERROR as $KEY=>$VALUE) {

$MSG.= ‘<li style=”font-family:verdana; font-size:12px; color:#ff0000;”>’ . $KEY .’: ‘ .  $VALUE . ‘</li>’;

}

echo $MSG . ‘</ul></div>’;

} else {

echo ‘<div style=”margin-top:10px margin-buttom:10px; border:1px dashed #000000; background-color:#d8d8d8; font-family:verdana; font-size:12px; color:#ff0000;”>SUCCESS. CONTINUE</div>’;

}

}

function check_email($mail_address) {

$pattern = “/^[\w-]+(\.[\w-]+)*@”;

$pattern .= “([0-9a-z][0-9a-z-]*[0-9a-z]\.)+([a-z]{2,4})$/i”;

if (preg_match($pattern, $mail_address)) {

$parts = explode(“@”, $mail_address);

if (checkdnsrr($parts[1], “MX”)){

return “1″;

// return true;

} else {

return “The e-mail host is not valid.”;

// return false;

}

} else {

return “The e-mail address contains invalid charcters.”;

// return false;

}

}

}

SEO needs continuous innovations

Success in the realm of search engine optimisation demands a constant passion for research and innovations of the SEO Company. A systematic study and continuous research can only lead to the accurate strategy and a proper application of the strategy can raise the ranking of the website in the SERP. One should never forget the basics like Meta Tags, Alt Tags, vivid site map and others. Once you are ready, drive for the best ranks by off page optimizations like link building and PPC.

A careful study can reveal that unnecessary frequent changes can hardly earn any soft corner of the search engines.

This is true that Google is the unanimous leader among the search engines and it is also heard that Google does not remain always unbiased. Brushing asides controversies, we must admit that we all hanker after Google ranking for obvious reasons. Google Webmasters can be a helping tool at the initial level even to the search engine optimisation companies.

The problem becomes worse when the criteria and algorithm of the search engines vary widely.

May be, one method may satisfy one search engine, whilst the others may ignore it completely. The advantage is that most of the people all the world round uses Google the most, which means, we need to keep close watch on Google and act accordingly.

Everything about web hosting

The success of your website largely depends upon the web host, where your files reside. In fact, when the visitors intend to browse your website, the files from the web server are populated. It is the responsibility of the web hosting company to provide an unhindered service to populate your web pages whenever a visitor asks for.

The way, the domain name uniquely identifies your brand; the web host provides continuous support to display your website in the browsers of the visitors.

Whenever one decides to launch his website, the selection of the web hosting provider becomes most crucial. The jazzy banners and lucrative offers make things more complicated for you. It’s almost impossible to get the right kind of information about the web host, which is most important for a commoner. The proper web hosting review becomes essential to help you to reach at an authentic decision about your web host in the long run. One may like to know about the top 10 web hosting or the best green hosting before pursuing his decision making process. Most importantly, you can learn how the webmasters and the customers feel about their services.

If your application demands dedicated server, then you must look forward to a more service oriented web hosting company, as managing a dedicated server requires better technically equipped people.

Like every other fields, pricing plays a crucial role in case of web hosting also. As an example, a company brand is much more important than the website of an amateurish individual. It’s always better to look forward to the reviews of different categories of people. Never forget that a webmaster looks into the host completely from a different perspective than a generic user.

Turn to the unique Web hosting Reviews and Rating services for a consolidated view on the current status of different web hosting providers to make your decision more realistic, so that it yields in the long term.

Cross Browser Window – Open In Javascript

Now a days, browser dependent scripts like javascript create problems due to the varieties of clients and versions of different browsers. So, the programmers or the web developers should be alert to implement such scripts on web. The scripts should be necessarily cross browser compatible …..

Check the simple window.open function….

var myPopupWindow = ”;
function openPopupWindow(url)
{
//If it is already open
width=getSize();
width=width-200;
//alert(encodeURI(url));
if (!myPopupWindow.closed && myPopupWindow.location)
{
myPopupWindow.location.href = encodeURI(url);
}
else
{
myPopupWindow= window.open(encodeURI(url),name, “location=no, scrollbars=yes, resizable=yes, toolbar=no, menubar=no, width=” + width + “, height=600,top=250,left=150″);
if (!myPopupWindow.opener) myPopupWindow.opener = self;
}
//If my main window has focus – set it to the popup
if (window.focus) {myPopupWindow.focus()}
}

The web programmer can never ignore the importance of cross browser applications as the browsers of the individuals are completely obscured from the programmer at the time of programming.

WORKING WITH REST

rest-client.php

<?
$rs=”http://localhost/rest/rest-server.php”;
$qs=”";
$parray=array(‘amount’=>”15.00″);
foreach($parray as $par=>$value){
$qs=$qs.”$par=”.urlencode($value).”&”; }
$uri=”$rs?$qs” . “aid=01″;
echo $qs . “<br>” . $uri . “<br>”;
$cobj=curl_init($uri);
curl_setopt($cobj,CURLOPT_RETURNTRANSFER,1);
$xml=curl_exec($cobj);
curl_close($cobj);
echo htmlspecialchars($xml);
?>

rest-server.php

<?
$amount=$_GET["amount"];
if ($_GET['aid']!=”010915780″)
{
echo “Invalid A ID”;

}
else
{
$taxcalc=$amount;
echo “<?xml version=\”1.0\”?>”;
echo “<taxinfo>”;
echo “<result>”.$taxcalc.”</result>”;
echo “<result>”.$taxcalc * 20 .”</result>”;
echo “</taxinfo>”;
}
?>

Test It.