Sunday, 11 February 2018

Yay, I have successfully managed to connect database with view in Codeigniter.


Thanks to java for OOP concepts. This is the new era of web development. 😉😉

Sunday, 4 February 2018

PHP Tutorial | Easiest Way To Add Pagination On Web Site | Using php, phpmyadmin, Javascript

Watch video and you follow my steps to perform pegination on web site..

Source code :-

<html>
    <head>
        
       
    </head>
<body>
    <?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "tutorial";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

$sql = "SELECT * FROM employees";
$result = $conn->query($sql);
while($row = $result->fetch_assoc())
        {
            echo "id: " . $row["id"]. " - Name: " . $row["name"]."<br/>";
        }
?>
        <button onclick="getElementById('page').innerHTML='Dynamic Display'">Click here</button>
      
    <div id="page"></div>
</body>

Friday, 2 February 2018

PHP Tutorial : Find Upcoming Date From Database | WAMP | LAMP | phpmyadmin



Source Code :- Next_day.php
<?php
//$name=$_POST["name"];
$con=new mysqli("localhost","root","","test");
$result=$con->query("select * from dates order by date ASC");
$year=date("Y");
while($row = $result->fetch_assoc()) {
       // echo "Date:" . $row["date"]." Day :". $row["name"]."<br/>";
        if($year==  substr($row['date'], 0, 4))
        {
           
            if((int)substr($row['date'], 5, 6)==(int)date("m"))
            {
                if((int)substr($row['date'], 8, 9)>(int)date("d"))
                {
                    echo "Upcoming Date:" . $row["date"]." <br/>Upcoming Day :". $row["name"]."";
                    break;
                }
            }
            else if((int)substr($row['date'], 5, 6)>(int)date("m"))
            {
                echo "Upcoming Date:" . $row["date"]." <br/>Upcoming Day :". $row["name"]."";
                break;
            }
        }
    }
?>

Sunday, 28 January 2018

PHP Tutorial : Include Page On Button Click Without Refreshing Main Page | Dynamic Page Loading

Remember that this technique has 1 drawback, watch the video above to understand it. Comment down if you have any questions.
Source Code :-
dynamic.php
<head>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){ $("b").click(function()
    {
    document.getElementById("include").innerHTML = "<?php echo include('Second.php');
?> "; });
    $(document).on("click", "a.remove" , function()
    { $(this).parent().remove(); }); });
</script>
</head>
<body>
<b><input type='submit' value='Add second page'></b>
<div id='include'></div>
</body>

Second.php
<?php
echo 'This is second page';
?>

Using CodeIgniter For The First Time

Hello visitors, this is unpossible POG. And Oh My God! I am using CodeIgniter for the first time. I am using Linux OS (Ubuntu 17.10) and Netbeans IDE for assisting me in coding. It is challenging to work on MVC because I develop web page in normal PHP code. I may not create any tutorials on it because I am newbie. Although Java's OOP concept is helping to know how controller actually works. I hope it will help me to reach next level.

Friday, 26 January 2018

How To Set Today's Date By Default In Calendar | WAMP | PHP Tutorial



Source code :- tutorial.php
<?php
date_default_timezone_set("Asia/Kolkata");
?>
<form>
<input type="date" value="<?php     echo date('Y-m-d');          ?>">
<input type="submit" value="Send">
</form>

Monday, 22 January 2018

WAMP Tutorial : Restrict Direct URL Access And Redirect To Login Page [Download Code From Links]

Source code :-  Copy paste those codes, and give the file name same as given below. Enjoy.
login.php

<form action="check.php" method="post">
Enter username<input type="text" name="name">
Enter username<input type="password" name="pass">
<input type="submit" value="login">
</form>

check.php


<?php
session_start();
$uname=$_POST['name'];
$pass=$_POST['pass'];
if($uname=='unpossible' && $pass=='pog')
{
$_SESSION['logged_in']='1';
include('sensitive_data.php');
}
else
{
echo "get out from here";
}
?>

sensitive_data.php

<?php
if(isset($_SESSION['logged_in']))
{
?>
this page has sensitive data. very important data.

<?php
}
else
{
include('login.php');
}

?>