Tuesday, 14 March 2017

How to design login page for web application

Welcome back guys, here is custom made login template for your web app, on this tutorial am going to show you guys how to design login page, our output is simply going to look like this.


So, let start making our login page, first let create an empty file, name it login.html

Secondly add below code to our login.html file we just created earlier


<!DOCTYPE html>
<html>
<head>
 <title>Login Page</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>

<div class="container">
<div class="logo">
 <img src="img/logo1.png">
</div>
 <div class="form">
  <form method="post" action="" autocomplete="">
   <p><label name="username">Username:</label>
   <input type="text" required="" name="username">
   </p>

   <p><label name="password">Password:</label>
   <input type="password" required="" name="username">
   </p>
   <p><input type="submit" value="Sign In" name="username">
   </p>
  </form>
 </div>
</div>

</body>
</html>

So, i guess is not that hard for you to ride along...
Thirdly let create all our css classes, and tag identifiers open another empty page and save it as style.css, copy below css code to it and save.

Our container class hold the content of our whole login code and that is where we defined our width: 500px; and margin-top: 200px.

Our background image could be download from  here

using css tag identifier we called up our body and set some property and attribute to make our background

 body
  {
   background-image: url(../img/bg1.jpg);
   background-size: 1400px;
  }

Then, the login button was tweaked with css to gain that nice attractive looking, below is the css code for login button, sure you can tweak it around.

input[type=submit]
  {
   width: 100px;
   border-radius:10px;
   font-size: 14px;
   font-family:cursive;
   padding-left: 10px;
   padding-top: 5px;
   padding-right: 10px;
   padding-bottom: 5px;
   background-color: #007497;
   color: #fff;
   font-weight: bold;
   cursor: pointer;
  }
  input[type=submit]:hover
  {
   
   cursor: pointer;
   background-color: #015d79;
  }

Click demo to see the final out and download for your next web app... see you yeah

Monday, 27 February 2017

Lightweight countdown timer

School days are pretty awesome, run back kicking and hailing all the these we could do, Physics and Chemistry class were taught for me but i made it all through, stop watch and countdown were used those time to determined how long reaction can take place, so far so good.
Surely get through that using javascript believe me working around js is really fun and great, every programming language has it's weak point somewhere, am going to cut it pieces providing solution, having good time with js, I bet you won't forget this day you make up your mind to try javascript, speeding that one minute is a worthwhile. if you're working on a timing project this will give you a workout. pretty sure about that. we're just going to great function in js and parse it around to get what you desire, easy right?

Download ScriptDemo

<script>
     $(document).ready(function(){

   var c = 60*60*60;
         var t;
            timedCount();
            function timedCount() {
             var hours = parseInt( c / 3600 ) % 24;
             var minutes = parseInt( c / 60 ) % 60;
             var seconds = c % 60;
             var result = (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":" + (seconds  < 10 ? "0" + seconds : seconds);
             $('#timer').html(result);
                if(c == 0 ){ c = 60*60*60; }
                c = c - 1;
                t = setTimeout(function(){ timedCount() }, 1000);
            }
     });
    </script>

c = 60*60*60; the very first 60secs count for hours and second 60 sec count for minuuteand third count for secs
parse it against 24 hours, parse minut against 60 seconds. this is the workthough.

Call up $('#timer').html(result); to populate the counting figure, a function was created timedCount()

Here is the demo just in case, u wanna work it around to suit your need or download the code below.



Friday, 24 February 2017

My New Year Resolution

Hey guys how have you been all these while? I'm little bit OK for my new year resolution plan, kind of thing that i found interesting. Somehow, somewhat it all happened right? did your resolution worked for you? or did you even had one? haha. Sorry i don't wanna break rules here as part of my resolution, because life is for learning and learning for life, the difference between wrongs and right.

        Today is going to mark one of my most happiest day in my life, it's been 23 years as i give a  dam chance for Military job here in Nigeria, i have passion, love for combats, weapons, armory, jungle runs and training, i think is a time i give a thought about it, this year is super awesome for me with all this military and weapons stuff it will make a long run and a huge differences. 
So, it's 2017 again with this military stuff on my new year resolution plan, finally got the form picked and called for test into the Nigeria Airforce this is wonderful. 

Now, today been sat, 25-02-2017 is gonna make it all happen with some extra few benefit, i have been in Port harcourt, choba to be precise for few days now with a friend Governor George, I never had a sweet night since then, spending my whole night on UNIPORT School campus preparing for today test, pretty awesome right? that's what i thought as well. I'm not going to dump my programming skill these are extra few benefit to my career  i build around Military. Anyway i will be at 115 Special Operations Group, Nigerian Air Force, Port-Harcourt.  before 9:00 am in the morning.

Why Join Nigerian Airforce

This stuff really wired me out every time i give a thought, because this is the career i choose for myself all these life. I'm going to this airforce, military of a thing because i want to be, this will really gonna make me feel good and better, salary is a secondary option for me, I always wanted to know thing that makes me happy. so choose this life, me and myself with my playmate(Short Gun) riding along the beach fishing and hunting for demons on the rough side of heaven, i am that man i really want to be all these years hope you understand...

Talk is cheap, how about my parents? are they really proud of this my new year resolution, aaah that's alot to ask, pretty sure i think they do, my Dad have been hunting animals for some years and some time i go hunting with him on weekend sunrise days, this really over whelm and triggered this eagerness to join the Airforce, willingness, able and ready all the time.

I love travelling most of the time, i never had the chance to travel around country with my Dad, like going to some fishing, tourist, business trip and all that stuff never kick off.

So, if you're reading this probably i got less than 5 hours left to be there, promised to never make the mistake they made. maybe this new resolution gonna work out well. Ahh hmm never had a new year resolution before anyway. 

Friday, 27 January 2017

Pascal Program to Find Factorial of a Any Positive Number

Hey, is been a while today tutorial is on Pascal Program to Find Factorial of  Any given Positive Number, You will be able to Calculate the factorial of a number using the example i have given below.

 I'm sharing this code because it was my examination question on final year of computer Science, Heritage Polytechnic Eket Akwa Ibom State, here in Nigeria.

I have seen this question a lot of time been asked an there is no appropriate answer to it, so i wrote this lines of code in pascal to solve this long time mind troubling question.  

You will learn to calculate the factorial of a number using for loop in this example.

Therefore, This example uses nested for loop function in pascal. this pascal program generates factorial.

The factorial of a positive number n is given by:

factorial of n (n!) = 1*2*3*4....n

Example: Factorial of a Number In Pascal



program FactorialOfAnyNumber;
var
i,a,b,j:integer; {initialize variables}
begin
writeln('Enter Any number:'); { Display message for next action}
readln(j); {accept input from keyboard}

for i := 1 to j do {loop through value store in j variable}
begin
a:=i*a; {incremnet as it loop an store result in a variable}

for a:=1 to a do { loop result}
begin
  b:=a; {store total answer to to variable b}
end; {end for loop statement}
end; {end for loop statement}

  writeln('The factorial of ',j,' is = ',b); {Dispay result on screen}
readln(); {delay message}
end. { end program, terminate }

This program takes a positive integer from the user and computes factorial using for loop.

Friday, 13 January 2017

Check how many users are logged in your website using php

Total number of users  online
Total number of users  online
Hello guys, is me again with another demanded tutorial, If you are a developer, then this is very important tutorials for you, the best way to count logged in users in php, fasting your keyboard and please keep close attention in this post.




Demo Download
So, today i am going to explain how many users are logged in to your website, I will unveil the code written in php, knowing the number of users logged in your site if you are trying to know how many users are logged in to your webpage, then you don’t need to worry anymore, is really such a nice way to tells you how many people are currently using your site, best to display this somewhere on your is just ok. the script is been test on [PHP: 5.4.7] working perfect and It is the very useful.

Now, there are few things to consider:

  •  Get the ip address of current logged in user
  •  Get current timestamp
  • Get logged in username
 This will help us to list the appropriate number of users online. 

How to get client IP address in php

One way to get user IP address is $_SERVER[REMOTE_ADDR] this track the IP address from which the user is viewing the website.
$_SERVER is a PHP super global variable which holds information about headers, paths, and script locations.


$_SERVER['REMOTE_ADDR']; // Returns the IP address from where the user is viewing the current page

With the code above you would track any IP address viewing your webpage. 

PHP time(); Function

int time ( void ) Returns the current time measured in the number of seconds
time(); example
<?php
$upWeek = time() + (7 * 24 * 60 * 60);
                   // 7 days; 24 hours; 60 mins; 60 secs
echo 'Now:       '. date('Y-m-d') ."\n";
echo 'Next Week: '. date('Y-m-d', $upWeek) ."\n";
// or using strtotime():
echo 'Next Week: '. date('Y-m-d', strtotime('+1 week')) ."\n";
?>

The above example will output something similar to:
Now:       2017-01-13
Next Week: 2017-02-06
Next Week: 2017-02-06


The function time() returns always timestamp that is timezone independent (=UTC). Check PHP Website for more info.

How to get current timestamp


<?php
$current_time=time(); // Return the current time as a Unix timestamp
echo $current;
?>

This return the current time as a Unix timestamp
In addition to format it to a date:


<?php
$current_time =time();
echo($current_time . "<br>");
echo(date("Y-m-d",$current_time));
?>

Table structure for logged in users script


CREATE TABLE IF NOT EXISTS `total_visitors` (
  `id` int(11) NOT NULL,
  `session` varchar(100) NOT NULL,
  `ip` varchar(50) NOT NULL,
  `status` int(11) NOT NULL,
  `time` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Source code for count how many users are logged.



<?php
 $current_time=time(); // Return the current time as a Unix timestamp
 $timeout = $current_time - (120); // 2min, How long ago
 $user_ip=$_SERVER['REMOTE_ADDR']; // get user ip address

if($_SESSION)
 {
 $session_exist = $db->query("SELECT session FROM total_visitors WHERE session='".$_SESSION['username']."'");
 $session_check = mysqli_num_rows($session_exist);
 if($session_check)
 {
$sql = $db->query("UPDATE total_visitors SET time='".time()."' WHERE session='".$_SESSION['username']."' ");
 }
 else{
  $db->query("INSERT INTO total_visitors values ('','".$_SESSION['username']."','".$user_ip."','1','".$current_time."')");

 }
}
 $select_total = $db->query("SELECT * FROM total_visitors WHERE time>= '$timeout' AND status=1 ");
 $total_online_visitors = mysqli_num_rows($select_total);

 $total_online = $db->query("SELECT * FROM total_visitors WHERE time>= '$timeout' ");
 $count_visitors = mysqli_num_rows($total_online);


<p>In total there is <strong><?php echo number_format( $count_visitors); ?></strong> user online :: 
<br> <strong style="color: #098;"><?php echo number_format($total_online_visitors);?> </strong>
registered and <strong><?php echo number_format($total_online_guest);?></strong> guest <br>
<b>in last 1 minutes</b>!</p>

Demo Download
Alright, see you guys later… subscribe, share with friend…

Friday, 6 January 2017

How to create forgot password system in PHP

Hi, I am trying to make forgot password script on www.thewallclone.com and I do not worry about it, because it was successful. In this post we are going to learn how to implement forgot password system on our web application, recover lost password from account using php, on this forgot password system we have form for account verification that will help us to create a new password for that account.




First, we are to verify either the user email address to send reset link for an opportunity to create new [fresh] password. The Password recover email has a link to the page where we can reset password.

How does password recovery work ?

Password Recovery help you recover lost and forgotten password or an opportunity to create new password or reset password.
E-mail verification is use to send a reset link to the user. Generate a unique random code, tie it to the user account, probably set an expiration time this is optional and store them into the database. Then generate a unique link and mail it to the user email address during registration.
So, for the verification aspect. When the user clicks the link, they will have the following data at your disposal: the email, and the token (a unique random code). That should be enough to do verification.  This part do the following checks:
  • Is the email valid?
  • Is the email-token binding valid?
  • Is the token expired? (Optional)
  • Has the token been used?
  • Is the token field empty?

If all checks out, allow the user to provide a new password/verify their email. No matter success or failure, it is very important to invalidate the token after use.
Check demo here download source code.

Basic PHP mail() Function code to send emails from a form


Now, on this tutorial we are using basic PHP mail() Function code to send emails from a form. You can use the PHP mail() function to send an email with PHP. The simplest way to do this is to send a text email. This is one way to handle sending emails to your users.


/* Send a link to reset password */
$to = $email;
$subject = "reset password link";
$header = "By codexpress";
$body = "here is your link to reset your password
For active your account, visit the link below to complete : 
http://www.thewallclone.com/updatepassword.php?email=$email&code=$code";

$sent=mail($to,$subject,$body,$header);
if ($sent) 
{
echo ' Sent success';
} 

index.php

Index contain verification form and validation code change where you find thewallclone.com to your own domain.

Html form

<?php
include 'config.php';
?>
<!DOCTYPE HTML>
<html>
<head>
    <title>How to create forget password recovery procedure in PHP by Codepress</title>
</head>
<body>
 <h2>Reset Password</h2>
    <form method="post" action="#">
    
        <p><label>Email: </label><input type="text" name="email" /></p>
        <p><input type="submit" name="submit" value="Reset"/></p>
    </form>
</body>
</html>

Verification code

<?php
 if (isset($_POST['email']) && ($_POST['email']!="")) {
  # code...
  $email=trim($_POST['email']); // get email address from user form
  $code=md5(uniqid(true)); // random alphernumeric character store in $code variable
  
  if (!filter_var($email, FILTER_VALIDATE_EMAIL) === false) {

   $checkmail=$db->query("SELECT email FROM users WHERE email='$email' ") or die(mysqli_error('Run time error...'));
   $count=mysqli_num_rows($checkmail); // check if user is on our data base

   if ($count==1) { // if email is stored in our database update lost password field with random code for reset
    # code...s
    $inserted=$db->query("UPDATE users SET lost='$code' WHERE email='$email' ");
      // update our table users with unique random code
      /* Send a link to reset password */
      $to = $email;
      $subject = "reset password link";
      $header = "By codexpress";
      $body = "here is your link to reset your password
      For active your account, visit the link below to complete : 
      http://www.thewallclone.com/updatepassword.php?email=$email&code=$code";

      $sent=mail($to,$subject,$body,$header);
      
       # code...
    if ($inserted) { /* update is successfull */
     # code...
     echo("Check your mail we have sent you reset link to change your password! <br>");

    }
   }
   else
   {
     echo("Oops! Sorry, $email dose not belong to any account!");
   }

  } else {
    echo("$email is not a valid email address");
  }
 }
 $db->close();
 ?>

updatepassword.php

This file contain form reset password after done all the verification and validations

<?php
include 'config.php';
?>
<!DOCTYPE HTML>
<html>
<head>
    <title>How to create forget password recovery procedure in PHP by Codepress</title>
</head>
<body>
<?php
 if (isset($_GET['email']) && ($_GET['code']!="")) {
  # code...
  $code=$_GET['code'];
  $email=$_GET['email'];

  $checkmail=$db->query("SELECT email FROM users WHERE email='$email' AND lost='$code' AND lost!='' ") 
  or die(mysqli_error('Run time error...'));
  $count=mysqli_num_rows($checkmail);
  if ($count) {
   if (isset($_POST['password']) AND ($_POST['password']!="")){

     $password=md5($_POST['password']);
     $repassword=md5($_POST['repassword']);
     if ($password===$repassword) {
      # code...
      $inserted=$db->query("UPDATE users SET lost='', password='$password' WHERE email='$email' ");
       // insert into our table users with new password
      if ($inserted) {
       # code...
       echo "<h1>Successfully changed!</h1>
       <a href='index.php'>Return home</a>";
      }

     }
     else
     {
      echo "Password do not match!";
     }

   }
   # code...
   echo '
    <h2>Create New Password</h2>
    <form method="post" action="">
          <p><label>New Password: </label><input type="text" name="password" /></p>
          <p><label>Retype New Password: </label><input type="text" name="repassword" /></p>
          <p><input type="submit" name="create" value="Submit"/></p>
      </form>
   ';

  }
  else
  {
   echo "<h2>Error occure! <a href='index.php'>Return</a></h2>";
  }

  
 }
 $db->close();
 ?>
</body>
</html>
 

Database Schema

Here is the database schema for this tutorial.

-- Table structure for table `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(30) NOT NULL,
  `password` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `img` varchar(300) DEFAULT NULL,
  `lost` varchar(1000) NOT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ;
Don’t forget to share, subscribe to newsletters, or just say hello..

Tuesday, 3 January 2017

Imagenomic Portraiture 2.3.4 Plugin License key 2017 [LATEST]

This is a step by step on how to crack Imagenomic Portraiture plugin, this license key is a life saver, this is a onetime license/serial key for Photoshop portraiture, this plugin work with photoshop cs5, photoshop cs6, photoshop cc.  Below are the steps

Steps to Crack Imagenomic Portrature

First download Imagenomic  portraiture here take note of the directory were you are downloading the and install the licese/serial key free.
  • ·        Install Imagenomic Portraiture 2.3.4 Plugin
  • ·        Lunch Photoshop application
  • ·        Click on filter on menu bar and select Imagenomic >> portraiture

  • ·        Click install license key

Enter the following license key

 Download license key 

If you ever find this helpful please like, share and don’t forget to subscribe, don't be kick out of the box.

Monday, 2 January 2017

Mailchimp api 3.0 check if email is subscribed Solution

Hello guys is me again with another fresh tutorial on mailchimp api 3.0 this tutorial will help you to verify existing email on a mail chimp list, it will check if an email is subscribed on a particular list on your mail chimp account. Here is the solution, if you ever wondered why. Alright follow the steps and you do just fine or download to try it out yourself.

Demo Download

First get your Mail Chimp API credentials by signing into your mail chimp account



So, now click on your profile click account

Follow the screenshot if you are lost or comment below, select extra, click on API Keys
Click create a key to auto generate new API key, we are going to use it later.

Now the next is to get the list ID were users are subscribed to, select your favorite list.

Now soon as you click arrow a menu will display select SETTINGS.
There you find the list ID, Note will are going to use it later on.
First we are going to have two files let called them
  • Index.php
This php file contain subscriber form and validating form for existing subscribers and new subscibers.
  • Action.php
Action page contain php scipt for validating the subscriber if user is subscribed or not.

Index.php

<?php
session_start();
$statusMsg = !empty($_SESSION['msg'])?$_SESSION['msg']:'';
unset($_SESSION['msg']);
?>
<!DOCTYPE HTML>
<html>
<head>
    <title>Add subscriber to list using MailChimp API and PHP by CodexWorld</title>
</head>
<body>
 <h2>Subscribe Our Newsletter</h2>
    <?php echo $statusMsg; ?>
    <form method="post" action="action1.php">
    
        <p><label>Email: </label><input type="text" name="email" /></p>
        <p><input type="submit" name="submit" value="SUBSCRIBE"/></p>
    </form>
</body>
</html>



action.php

<?php
session_start();
if(isset($_POST['submit'])){

/* Database connection start */


    $email = $_POST['email'];
    $file_id = $_POST['file'];
    if(!empty($email) && !filter_var($email, FILTER_VALIDATE_EMAIL) === false){
        // MailChimp API credentials
        $apiKey = 'YOUR_API_KEY';
        $listID = 'YOUR_LIST_ID';
        
        // MailChimp API URL
        $memberID = md5(strtolower($email));
        $dataCenter = substr($apiKey,strpos($apiKey,'-')+1);
        $url = 'https://' . $dataCenter . '.api.mailchimp.com/3.0/lists/' . $listID . '/members/' . $memberID;

        // member information
$arr = array('email_address' => $email, 'status' => '');
$json = json_encode($arr);

        
        // send a HTTP POST request with curl
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_USERPWD, 'user:' . $apiKey);
        curl_setopt($ch, CURLOPT_HTTPHEADER, ('Content-Type: application/json'));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_TIMEOUT, 10);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
        $result = curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
     
        $json = json_decode($result);

        // store the status message based on response code
        if ($json->{'status'} == 400) {

                $_SESSION['msg'] = '
                <!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
    #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>

<div id="mc_embed_signup">
<form action="//codexpresslabs.us13.list-manage.com/subscribe/post?u=065a5a8d381de6c1aaba29e8c&amp;id=e5692a9974" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>

    <div id="mc_embed_signup_scroll">
    <div class="formstatus error">You have not subscribe to our mail List!</div>
    <h2>Subscribe to our mailing list</h2>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<div class="mc-field-group">
    <label for="mce-EMAIL">Email Address  <span class="asterisk">*</span>
</label>
    <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>

    <div id="mce-responses" class="clear">
        <div class="response" id="mce-error-response" style="display:none"></div>
        <div class="response" id="mce-success-response" style="display:none"></div>
    </div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
    <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_065a5a8d381de6c1aaba29e8c_e5692a9974" tabindex="-1" value=""></div>
    <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </div>
</form>
</div>
<!--End mc_embed_signup-->
';  

        } elseif($json->{'status'} == 'subscribed') {
            if ($num) {
               $_SESSION['msg'] = '<div class="formstatus" style="color: #EA4335"><a href="'.$url.'">Download Now</a></div>';
            }
            else
            {
               $_SESSION['msg'] = '<div class="formstatus error">This file does not exist!</div>';     
            }
            
        }
    }else{
        $_SESSION['msg'] = '<p style="color: #EA4335">Please enter valid email address.</p>';
    }
}
// redirect to homepage
header('location:download.php?file='.$file_id.' ');  

Demo Download

Hopefully you will find it helpful...share like and subscibe