Thursday, August 30, 2012

Make Forex Trading Easy


Make Forex Trading Easy 


Forex trading is good way to earn income. Earning is not easy in any trade Forex is also have some thing to learn and practice by your self before starting the trade.In Forex trading you should be familiar with following tropics and Forex terms used in trade
  •  Currency Trading
  • Reading a Quote and Understanding the Jargon
  • Forex: Benefits and Risks
  •  Forex: History and Market Participants
  •  Forex: Economic Theories and Data
  •  Forex: Fundamental Trading Strategies
  •  Forex: Technical Analysis
If you are new to Forex trading my recommendation is to start with broker.I recommend you to start with  e-toro with success cases i have seen as well as many more reason you will be realized when you start get use of it.


About eToro Taken from http://www.etoropartners.com 

eToro was born out of a gut feeling that the currency exchange market can be accessible to people other than just professionally trained Forex traders, and that all that’s standing between a person who’s interested in trading Forex and the Forex capital markets are needless complicated charts and graphs and intimidating lingo.
So we went with our feeling and created a platform that uses simple visualizations together with professional FX analysis tools in order to make the financial, Forex and commodities markets approachable to people who have thus far been intimidated by them.
We provide our beginner traders with tools to help them learn about global currency trading and join the international currencies market with confidence. Our platform offers Forex trading guides, tutorials and a demo mode where they can practice and see their progress.
However, we were not in any way prepared to compromise any of the tools a professional Forex trader needs at their disposal. We offer reliable real time execution of trades, over 10 currency pairs to trade in, with bottom low spreads of 2 pips for most of them, along with various charts and charting tools, and leverages ranging from 1:10 to 1:400.
We also offer commodity trading using the same user friendly interfaces where traders can buy and sell Gold, Silver and Oil. And guess what? Our revolutionary approach worked. Today eToro is a world leader in the field of online foreign exchange trading and our ground breaking software is a benchmark in the industry.

Importance of Twitter Followers


Importance of Twitter Followers

Twitter is very important as social media network and spreading your business as well.Twitter followers which sign up in your profile enable you to send your advertisements ,Recent blog post or massages to other people.By using twitter your products and services could be promoted.
              Twitter is a social network has tremendous popularity world wide where users can use short massage service (SMS) with other twitter members.and also can tweet your recent popular blog post in tweets.
It is very importance to get followers in twitter to whom you can send your massages containing  your popular blog post or marketing your products and services.
Twitter can be a great tool for interacting with your customers and marketing your goods and services  and it also a tool for collecting customers feed back.

Following are the simple ways of getting twitter followers
  • Provide link to your twitter profile in your email signature.
  • Provide link to your twitter profile using other social media networks
  • Provide link to your twitter profile in your blog or web site.
  • Following any one who could follows back you.
 Above simple methods get some time to build number of followers.and also get low number of followers.but your aim is propagate your massages among huge number of people with short period of time.In that case, I think the best way of getting followers by using the Tweet Adder software
 
Which has following features and many more

Profile Data Search search twitter bio, plus filters

Location Search search by geographic location around the world, plus filters

Twitter List Search imports another users twitter list

Followers of a User obtains a list of profiles following a particular user

Followed by a User obtains a list of profiles a user is following

Huge flexibility with result filters

Tuesday, August 21, 2012

Different User levels in Login

Different User levels in Login

Different levels of user access should be provided in database management system.Here in my example different users are directed to different pages.
First create table users2 in my database.

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(60) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(60) NOT NULL,
  `pass_word` varchar(60) NOT NULL,
  `user_type` varchar(40) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Then create register page as follows register.php


<?php
    session_start();
?>
<html>
<head>

<title>Registration Form</title>

</head>
<body>
<?php
    if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) >0 ) {
        echo '<ul class="err">';
        foreach($_SESSION['ERRMSG_ARR'] as $msg) {
            echo '<li>',$msg,'</li>';
        }
        echo '</ul>';
        unset($_SESSION['ERRMSG_ARR']);
    }
?>
<h2><center><font color=#f09718>Registration Form</font></center></h2>
<form id="loginForm" name="loginForm" method="post" action="register-check.php">
  <table bgcolor=#f09718 align="center">
  
    <tr bgcolor=#ffffff>
      <th width="124">User Name</th>
      <td width="168"><input name="user_name" type="text" class="textfield" id="user_name" /></td>
    </tr>
    <tr bgcolor=#ffffff>
      <th>Password</th>
      <td><input name="pass_word" type="password" class="textfield" id="pass_word" /></td>
    </tr>
    <tr bgcolor=#ffffff>
      <th>User Type </th>
      <td><select name="user_type">
                                <option value="1">Administrator</option>
                                <option value="2">User1</option>
                                <option value="3">User2</option>
        </select></td>
    </tr>
    <tr bgcolor=#ffffff>
      <td>&nbsp;</td>
      <td><input type="submit" name="Submit" value="Register" /></td>
    </tr>
  </table>
</form>
</body>

register-check.php 



<?php
 
    session_start();
 
 
    require_once('dbcon.php');
 
 
    $errmsg_arr = array();
 

    $errflag = false;
 

    $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    if(!$link) {
        die('Failed to connect to server: ' . mysql_error());
    }
 
    //Select database
    $db = mysql_select_db(DB_DATABASE);
    if(!$db) {
        die("Unable to select database");
    }
 
    //Function to sanitize values received from the form. Prevents SQL injection
    function clean($str) {
        $str = @trim($str);
        if(get_magic_quotes_gpc()) {
            $str = stripslashes($str);
        }
        return mysql_real_escape_string($str);
    }
 
    //Sanitize the POST values
    $user_name = clean($_POST['user_name']);
    $pass_word = clean($_POST['pass_word']);
    $user_type = clean($_POST['user_type']);
 
    //Input Validations
  
 
    if($user_name == '') {
        $errmsg_arr[] = 'Login ID missing';
        $errflag = true;
    }
    if($pass_word == '') {
        $errmsg_arr[] = 'Password missing';
        $errflag = true;
    }
    if($user_type  == '') {
        $errmsg_arr[] = 'User Type  missing';
        $errflag = true;
    }
  
 
    //Check for duplicate login ID
    if($user_name != '') {
        $qry = "SELECT * FROM users2 WHERE user_name='$user_name'";
        $result = mysql_query($qry);
        if($result) {
            if(mysql_num_rows($result) > 0) {
                $errmsg_arr[] = 'Login ID already in use';
                $errflag = true;
            }
            @mysql_free_result($result);
        }
        else {
            die("Query failed");
        }
    }
 
 
    if($errflag) {
        $_SESSION['ERRMSG_ARR'] = $errmsg_arr;
        session_write_close();
        header("location: register.php");
        exit();
    }


    $qry = "INSERT INTO users2(user_name, pass_word , user_type) VALUES('$user_name','".md5($_POST['pass_word'])."','$user_type')";
    $result = @mysql_query($qry);
 
    //Check whether the query was successful or not
    if($result) {
        header("location: register-success.php");
        exit();
    }else {
        die("Query failed");
    }
?>

register-success.php 


<html>
<head>
<title>Registration Successful</title>
</head>
<body>
<h1>Registration Successful</h1>
<p><a href="login.php">Click here</a> to login to your account.</p>
</body>
</html>

login.php 


<fieldset>
            <legend>User Login</legend>
<form id="loginForm" name="loginForm" method="post" action="login-exc.php">
            <label>Username</label><br>
            <input size="30" name="user_name" type="text"><br>
            <label>Password</label><br>
            <input size="30" name="pass_word" type="password"><br>
            <label>User Type</label><br>
            <select name="user_type">
                                 <option value="1">Administrator</option>
                                <option value="2">User1</option>
                                <option value="3">User2</option>
 </select><br>
            <input value="Submit" type="submit">
</form>
        </fieldset>

login-exc.php 

<?php
 
    session_start();
 
 
    require_once('dbcon.php');
 
 
    $errmsg_arr = array();
 

    $errflag = false;
 
 
    $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    if(!$link) {
        die('Failed to connect to server: ' . mysql_error());
    }
 
    //Select database
    $db = mysql_select_db(DB_DATABASE);
    if(!$db) {
        die("Unable to select database");
    }
 
 
    function clean($str) {
        $str = @trim($str);
        if(get_magic_quotes_gpc()) {
            $str = stripslashes($str);
        }
        return mysql_real_escape_string($str);
    }
 
 
    $user_name = clean($_POST['user_name']);
    $pass_word = clean($_POST['pass_word']);
   $user_type = clean($_POST['user_type']);
    //Input Validations
    if($user_name == '') {
        $errmsg_arr[] = 'Login ID missing';
        $errflag = true;
    }
    if($pass_word == '') {
        $errmsg_arr[] = 'Password missing';
        $errflag = true;
    }
   if($user_type == '') {
        $errmsg_arr[] = 'User Type missing';
        $errflag = true;
    }
    //If there are input validations, redirect back to the login form
    if($errflag) {
        $_SESSION['ERRMSG_ARR'] = $errmsg_arr;
        session_write_close();
        header("location: login.php");
        exit();
    }
 
 
    $qry="SELECT * FROM users2 WHERE (user_name='$user_name' AND pass_word='".md5($_POST['pass_word'])."' AND user_type='$user_type')";
    $result=mysql_query($qry);
 
    switch($user_type){
case 1:
    //Check whether the query was successful or not
        if($result){      
    if(mysql_num_rows($result) == 1){
        //Login successful
            session_regenerate_id();
            $login = mysql_fetch_assoc($result);
            $_SESSION['SESS_username'] = $login['user_name'];
            $_SESSION['SESS_usercategory'] = $login['pass_word'];
            $_SESSION['SESS_password'] = $login['user_type'];
          
            session_write_close();
            header("location: sample1.php");
               exit();
            }else {
            //Login failed
            header("location: login_failed.php");
            exit();
            }
        }
       break;
     
case 2:
    //Check whether the query was successful or not
 if($result){      
          if(mysql_num_rows($result) == 1){
        //Login successful
            session_regenerate_id();
           $login = mysql_fetch_assoc($result);
            $_SESSION['SESS_username'] = $login['user_name'];
            $_SESSION['SESS_usercategory'] = $login['pass_word'];
            $_SESSION['SESS_password'] = $login['user_type'];
            session_write_close();
            header("location: sample2.php");
               exit();
            }else {
            //Login failed
            header("location: login_failed.php");
            exit();
            }
        }
     break;
   
case 3:
    //Check whether the query was successful or not
    if($result){      
    if(mysql_num_rows($result) == 1){
        //Login successful
            session_regenerate_id();
           $login = mysql_fetch_assoc($result);
            $_SESSION['SESS_username'] = $login['user_name'];
            $_SESSION['SESS_usercategory'] = $login['pass_word'];
            $_SESSION['SESS_password'] = $login['user_type'];
          
            session_write_close();
            header("location: sample3.php");
               exit();
            }else {
            //Login failed
            header("location: login_failed.php");
            exit();
            }
        }
     break;
default:die("Query failed");
     exit();
    }
       
  
?>


sample1.php
 sample1</br>
<?php
require_once "authorization.php"; 
echo "welcome".$_SESSION['SESS_username'];
?>
 <a href="logout.php">Logout</a>
sample2.php
 sample2</br>
<?php
require_once "authorization.php"; 
echo "welcome".$_SESSION['SESS_username'];
?>
<a href="logout.php">Logout</a>
sample1.php
sample3</br>
<?php

require_once "authorization.php";  
echo "welcome".$_SESSION['SESS_username'];
?>

 <a href="logout.php">Logout</a>

authorization.php 



<?php 
//Start session    session_start();    
if(!isset($_SESSION['SESS_username']) || (trim($_SESSION['SESS_username']) == '')) {        header("location: access-denied.php");     
exit();    }
?>

access-denied.php 


<html>
<head>
<title>Access Denied</title>
</head>
<body>
<h1>Access Denied </h1><p align="center">&nbsp;</p><h4 align="center" class="err">Access Denied!<br />  You do not have access to this resource.</h4>
</body>
</html>

logout.php

<?php
 
    session_start();
 
 
      unset($_SESSION['SESS_username']);
      unset($_SESSION['SESS_usercategory']);
    unset($_SESSION['SESS_password']);
?>
<html>
<head>

<title>Logged Out</title>

</head>
<body>
<h1>Logout </h1>
<p align="center">&nbsp;</p>
<h4 align="center" class="err">You have been logged out.</h4>
<p align="center">Click here to <a href="login_form.php">Login</a></p>
</body>
</html>

Saturday, August 18, 2012

Multiple Selection in to a MySQL table


Multiple Selection in to a MySQL table

Drop down select only one option and no any issues with sending single value into a MySQL table.But look at bellow multiple select  box.

We could select multiple item listed here by using shift key.with simple scripting you could also sent the selected values in to a MySQL table.I have created table called multiple in my_database as follows

CREATE TABLE IF NOT EXISTS `multiple` (
  `id` int(30) NOT NULL AUTO_INCREMENT,
  `multy_name` varchar(40) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Then created above html file.

<form action="send.php" method="post">
<select name="test[]" multiple="multiple">
    <option value="one">one</option>
    <option value="two">two</option>
    <option value="three">three</option>
    <option value="four">four</option>
    <option value="five">five</option>
</select>
<input type="submit" value="Send" />
</form>

send.php Which will be sending data into MySQL table is as bellow

 
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("my_database", $con);
    $test=$_POST['test'];
    if ($test){
     foreach ($test as $t){
mysql_query("INSERT INTO multiple
VALUES ('', '$t')");

}
    }
echo "<font color='red'>successfull!</font>";
mysql_close($con);
?>

Stored data looks like bellow in the table.



Friday, August 17, 2012

PHP Installer

PHP Installer

Some PHP applications need to have installer to install databases, in order to install database and tables provided by php applications we have to input our password,user name,database name etc.which are to be written into the file mostly name as config.php to install the tables.You need to post your following details to to be written into confg.php by using bellow table.


Input Host Name
Input Password
Input Database Name
Input Table Name
Click To Install The Application


<table bgcolor=#445275 align="center">
<form action="install.php" method="post">
<tr bgcolor=#cfd9f5><td>Input Host Name</td><td><input type="text" name="host"></td></tr>
<tr bgcolor=#cfd9f5><td>Input Passward</td><td><input type="text" name="pward"></td></tr>
<tr bgcolor=#cfd9f5><td>Input Database Name</td><td><input type="text" name="dbname"></td></tr>
<tr bgcolor=#cfd9f5><td>Input Table Name</td><td><input type="text" name="tbname"></td></tr>
<tr bgcolor=#cfd9f5><td>Click To Inatall The Application</td><td><input type="submit" value="Install"></td></tr>
</form>
</table>

install.php will write the above information into config.php shown 2nd bellow


<?php
$host=$_POST['host'];
$pward=$_POST['pward'];
$dbname=$_POST['dbname'];
$tbname=$_POST['tbname'];
$myFile = "config.php";
$fh = fopen($myFile, 'w') or die("can't open file");
$tag1="<?php";
$host="\$host='$host';\n";
$pward="\$pward='$pward';\n";
$dbname="\$dbname='$dbname';\n";
$tbname="\$tbname='$tbname';\n";
$tag2="?>";
fwrite($fh, $tag1);
fwrite($fh, $host);
fwrite($fh, $pward);
fwrite($fh, $dbname);
fwrite($fh, $tbname);
fwrite($fh, $tag2);
fclose($fh);
header("location: config.php");

?>

config.php :-Empty file created to write above details bellow it has written with the data i entered



<?php
$host='localhost';
$pward='novotelwebinfoplus';
$dbname='infoplus';
$tbname='wintable';
?>

Saturday, August 11, 2012

Free Software Links



Free Software Links



Web BrowsersAnti Virus Programs








Free Office Suites

Photo Editing Software





Text Editorshttp://www.gimp.org/images/news-icons/wilber.pngGimp

Notepad++


PSPad


Komodo Edit


Programmer’s Notepad


TotalEdit


Crimson Editor


Nvu


Amaya


RText






Move to Next and Previous records PHP MySQL



Move to Next and Previous records PHP MySQL

Viewing single record and move from one record to another could be done in MySQL by using PHP.Bellow table I have taken from person table in my_database, which you have created in previous tutorial.anyway creating the table also,I have included codes bellow.

CREATE TABLE IF NOT EXISTS `person` (
  `id` int(45) NOT NULL AUTO_INCREMENT,
  `FirstName` varchar(15) DEFAULT NULL,
  `LastName` varchar(15) DEFAULT NULL,
  `birth_day` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `person`
--

INSERT INTO `person` (`id`, `FirstName`, `LastName`, `birth_day`) VALUES
(1, 'Scarl', 'Johan', '1949-06-04'),
(2, 'Clooneer', 'Henderson', '1974-06-04'),
(3, 'Katena ', 'Daviddson', '1950-06-04'),
(4, 'Mark', 'Jones', '1955-06-05'),
(5, 'Silvi', 'James', '1970-06-05'),
(6, 'Jerry', 'Harfer', '1987-04-08'),
(7, 'Mark', 'Header', '1955-03-08'),
(8, 'Kim', 'Darrel', '1990-06-05'),
(9, 'Tiny', 'Dare', '1951-06-05');

Displaying data file looks like as in bellow

Person details

Clooneer
Henderson
1974-06-04
Following codes move records as previous and next

<h2><center>Person details</center></h2>
<?php
mysql_connect("localhost", "root", "");
mysql_select_db("my_database");
if(isset($_GET['id']) && (int)$_GET['id']) $id = $_GET['id'];
else $id = 1;

$query = "SELECT*FROM person WHERE id = '$id' LIMIT 1";
$result = mysql_query($query);
if($num=mysql_numrows($result))
{
$record = mysql_fetch_assoc($result);
$fname = $record["FirstName"];
$lname = $record["LastName"];
$birth_day =$record["birth_day"];

echo "<table bgcolor=#7c98d5 align='center' width=200><tr bgcolor=#e2e6ef><td>".$fname."</td></tr>";
echo "<tr bgcolor=#e2e6ef><td>".$lname."</td></tr>";
echo "<tr bgcolor=#e2e6ef><td>".$birth_day."</td></tr></table>";
echo $max;
}

$next = $id + 1;
$prev = $id - 1;
?>
<table align="center"><tr><td><a href="nrecord.php?id=<?php echo $prev;?>"><input type="button" value="<<"></a></td>
<td><a href="nrecord.php?id=<?php echo $next;?>"><input type="button" value=">>"></a></td>
</tr></table>