Posts

How to Create Dynamic Dependent select box using ajax

Image
  You need a dynamic dependent select box. We will explain how to create a dynamic dependent select box in PHP, jquery and ajax. index.php <?php include_once 'dbconfig.php'; ?> <html> <head> <title>Dynamic Dependent Select Box using Ajax</title> <script type="text/javascript" src="jquery-1.4.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#loding1").hide(); $("#loding2").hide(); $(".country").change(function() { $("#loding1").show(); var id=$(this).val(); var dataString = 'id='+ id; $(".state").find('option').remove(); $(".city").find('option').remove(); $.ajax ({ type: "POST", url: "get_state.php", data: dataString, cache: false, success: function(html) { $("#loding1").hide(); $(".state").html(html

How to Fetch Logged in Username

Image
  after login, we need to fetch the Username. We will explain How to Fetch Logged in the Username. index.php <?php include("db.php"); session_start(); if($_SESSION['username']=="") { session_destroy(); header("location:index.php"); } ?> <html> <head> <title>Fetch Loged in Username</title> </head> </body> <?php include('db.php'); $query="select * from user where username='".$_SESSION['username']."' "; $query1=mysql_query($query); $row=mysql_fetch_array($query1) ?> <h1> <?php echo $row['name']; ?></h1> </body> </html> db.php <?php mysql_connect('localhost','root',''); mysql_select_db('database'); ?>

How to Make Fees Receipt in PHP Using Mysql Database

Image
  In this article, you will learn How to Make Fees Receipt in PHP Using Mysql Database. index.php <html> <title>Add fees</title> </head> <body> <h1><a href="add.php">Add receipt</a> &nbsp &nbsp &nbsp <a href="search.php">Record</a></h1> <form method="POST" oninput="x.value=parseInt(a.value)+parseInt(b.value)+parseInt(c.value)" action="fees.php"> <input type="date" name="date"><br/><br/> Name <input type="text" name="name"><br/><br/> Registration No. <input type="number" name="rno"><br/><br/> Course <select name="course"> <option>Select Course</option> <option value="PHP">PHP</option> <option value="JAVA">JAVA</option> <option value="ACCOUNTS

How to Create a Login system in PHP Using a Session

Image
In this article, we will explain how to create a login system in PHP using a session. ['username']!=$username && $row['password']!=$password) { $error="<p>Wrong User Name and Password</p>"; } if(isset($error)) { echo $error; } else{ require('db.php'); session_start(); $result =mysql_query("select * from users where username='$username' and password='$password'"); while($row=mysql_fetch_array($result)) { $_SESSION['username']=$row['username']; echo"<script>window.location.href='../invoice/'</script>"; } } } ?> db.php <?php mysql_connect('localhost','root',''); mysql_select_db('testbill'); ?>  

How to Fetch Data From Mysql Database using PHP

Image
  How to Fetch Data From Mysql Database using PHP, from inserted data in Mysql database. HTML Code <div class="table"> <div class="tab1"><h1>Name</h1></div> <div class="tab1"><h1>Father name</h1></div> <div class="tab1"><h1>Mother name</h1></div> <div class="tab1"><h1>E-mail</h1></div> <div class="tab1"><h1>Address</h1></div> <div class="tab1"><h1>DOB</h1></div> <div class="tab1"><h1>Category</h1></div> <div class="tab1"><h1>Image</h1></div> <div class="tab1"><h1>Action</h1></div> <div class="tab1"><h1>Delete</h1></div> <?php $query1 = "select * from table"; $query2 = mysql_query($q

How to Insert Data into Mysql Database using PHP

Image
In this tutorial, we will explain How to insert data into Mysql database using  PHP . If you want to save the record in one place then insert the data into the database. Below Steps: index.php <form method="post" action="insert.php" enctype="multipart/form-data"> <div class="name"> <div class="name1"><h1>Student Name:</h1></div> <div class="name2"><input type="text" name="name" value="" /></div> </div> <div class="name"> <div class="name1"><h1>Father Name:</h1></div> <div class="name2"><input type="text" name="father_name" value="" /></div> </div> <div class="name"> <div class="name1"><h1>Mother Name:</h1></div> <div class="name2"><input type="text

How to Create Input using JAVA

Image
In this article, you will learn How to Create Input using JAVA. It works like in  HTML  and  PHP Example:- import java.util.Scanner; // import the Scanner class class MyClass { public static void main(String[] args) { Scanner myObj = new Scanner(System.in); String userName; System.out.println("Enter username"); userName = myObj.nextLine(); System.out.println("Username is: " + userName); } }