Monday, November 28, 2022

Simple Count Down using Java-script - - HTML,CSS

Simple counter in java script 

Time Counter


-------------------------------------------

HTML Code:



<div class="counter">
<h4>Time Counter</h4>

<p id="demo"></p></div>



JavaScript Code:




<script type="text/javascript">
var dely=15;
var i = 0, howManyTimes = 16;
function f() {
if(dely>9){document.getElementById("demo").innerHTML=("00:"+dely--);}
else{document.getElementById("demo").innerHTML=("00:0"+dely--);}
i++;
    if( i < howManyTimes ){
        setTimeout( f, 1000 );
    }else{}
}
f();

</script>



CSS Code:

Thursday, November 24, 2022

Simple Search Box Example HTML 5 ,CSS 3

Many Frinds Ask me about a think how to put button inside a textbox so thats we see on many site search box like that .. thats not actully a button inside textbox its a div which contain both button and textbox and we hide their actul color :
Here is a simple example :


<div class="wrapper">
    <input type="text" />
    <button>GO</button>
</div>
<h3>Simple search Box Example</h3>
<h2>Programming Seekerz</h2>


<style>
.wrapper {
    border:1px solid #000;
    display:inline-block;
    position:relative;

}

input,
button {
    background-color:transparent;
    border:0;
}

button {
    position:absolute;
    right:0;
    top:0;
}

input {
    padding-right:30px; /* button padding */
}
</style>

Sunday, November 20, 2022

Thursday, November 17, 2022

File Handling in C++ :: Dev c++ 5.4.2

#include <fstream>
#include <iostream>
#include <string>
using namespace std;

int main()
{

string name;

cout << "What is your name? ";
cin >> name;

   ofstream out( "inputfile.txt",ios::ate );

if(out.is_open())

out << " My Name Is:  " << name << "!" << endl;

   else cout<<"Unable to Open File ";

        string line;

fstream in ("inputfile.txt");

        if(in.is_open()){

        while(getline(in,line) ){

        in>>line;

        cout<<line;
        
        }
}
        else{  cout<<"\nfile not open"; }

out.close();
return 0;
}

Tuesday, November 15, 2022

Interfaces in Java

package inhert;
public class Inhert  {
 public interface person{
         void name(String n);
         void age(int a );
         void clas(int c);
    }
   
    public static class usman implements person{
    public  void name(String n){
        System.out.println("Usman name= "+n);
    }
    public void age(int a){
        System.out.println("Usman age= "+a);
    }
    public void clas(int c){
        System.out.println("Usman class= "+c);
    }
    }
   
    public static class usama implements person{
    public void name(String n){
        System.out.println("Usman name= "+n);
    }
    public void age(int a){
        System.out.println("Usman class= "+a);
    }
    public void clas(int c){
        System.out.println("Usman class= "+c);
    }  
    }
   
  
       public static void main(String[] args){
           usama obj=new usama();
           obj.name("Usama hussain");
           obj.age(20);
           obj.clas(10);
          
           usman obj1=new usman();
           obj1.name("Usman Siddique");
           obj1.age(21);
           obj1.clas(9);
}   }
================================
An interface is a reference type in Java, it is similar to class, it is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface.
Along with abstract methods an interface may also contain constants, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods.
Writing an interface is similar to writing a class. But a class describes the attributes and behaviours of an object. And an interface contains behaviours that a class implements.
Unless the class that implements the interface is abstract, all the methods of the interface need to be defined in the class.
An interface is similar to a class in the following ways:
  • An interface can contain any number of methods.
  • An interface is written in a file with a .java extension, with the name of the interface matching the name of the file.
  • The byte code of an interface appears in a .class file.
  • Interfaces appear in packages, and their corresponding bytecode file must be in a directory structure that matches the package name.
However, an interface is different from a class in several ways, including:
  • You cannot instantiate an interface.
  • An interface does not contain any constructors.
  • All of the methods in an interface are abstract.
  • An interface cannot contain instance fields. The only fields that can appear in an interface must be declared both static and final.
  • An interface is not extended by a class; it is implemented by a class.
  • An interface can extend multiple interfaces.

Declaring Interfaces:

The interface keyword is used to declare an interface.

Sunday, November 13, 2022

Thursday, November 10, 2022

How to delete data in C# from sql database : code in c#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Data;
using System.Data.SqlClient;

namespace WebApplication1
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

 
        protected void Button2_Click(object sender, EventArgs e)
        {
            SqlConnection cnn = new SqlConnection(@"Data Source=localhost\SQLExpress;Initial Catalog=awais;Integrated Security=True;Integrated Security=True ");
            cnn.Open();
            string query = "delete from logout where name = '" +TextBox1.Text+ "';";
            SqlCommand cmd = new SqlCommand(query, cnn);
            cmd.ExecuteNonQuery();

            Response.Write("Deletion  is done!");

        }
    }
}

Wednesday, November 9, 2022

Insert data in SQL Database using c#.Net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

namespace WebApplication1
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
           
SqlConnection cnn = new SqlConnection(@"Data Source=localhost\SQLExpress;Initial Catalog=awais;Integrated Security=True;Integrated Security=True ");
cnn.Open();
           
string query="insert into logout(name,password) values('" + TextBox1.Text + "','" + TextBox2.Text + "' )";
SqlCommand cmd=new SqlCommand(query,cnn);
cmd.ExecuteNonQuery();

Response.Write("Saving is done!");


           
        }
         
        }
    }
}

Tuesday, November 8, 2022

HTML -Marquee Animation style with CSS

Marquee Style

<html>
<head>
<title>Marquee Style</title>
<style>
#wrapper {
  width: 100%;
  background-color: white;
  position: relative;
  height: 110px;
  line-height: 20px;
  margin: 1em auto;
  overflow: hidden;
}

div.marquee {
  position: absolute;
  text-align: center;
  animation-name: marquee;
  animation-duration: 5s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}


@keyframes marquee {  from {    left: 60%;  }
to {    left: -5em; } }
img{height:100px;width:100px;border:2px solid black;float:right;}
</style>
<head>
<div id="wrapper">
 <div class="marquee">
<table><tr><td><img src=" " alt=" "></td>
<td><img src=" " alt=" "></td>
<td><img src=" " alt=" "></td>
<td><img src=" " alt=" "></td>
<td><img src=" " alt=" "></td>
<td><img src=" " alt=" "></td></tr></table>
 </div>
</div>
<html>

Monday, November 7, 2022

Pop-up Login Form using Java-Script and CSS.

Simple Pop-up Login Form On Mouse Over using Java-Script CSS and HTML. Programming Seekerz :)

Download Full Code From This Link



HTML:
<div class="btn" onmouseover="fun()">

<h1> Take Mouse Over Me And the Pop-Up Appers</h1></div>

<div class="pic" id="pic1">
<input type="button" onclick="yoyo()" value="X" class="cn"/>

<form class="myform" action="abc.html" method="post">
<input type="text" class="items" placeholder="User Name"/>
<input type="Password" class="items" placeholder="Password"/>
<input type="submit" class="btn1" value="LOG-IN"/>
</form>


</div>

CSS:

<style>
.cn{color:red;background-color:white;border:2px solid;border-radius:50px;float:right;}

.btn{color: red;font-size: 22px;border:1px solid;text-align:center;}

.pic{width: 25%;height: 27%;display:none;bottom:40%;right:40%;position:fixed;
box-shadow: 3px -3px 59px 42px rgba(46,54,43,0.40);
}

.myform{
  margin: auto;
  padding: 0px;
  height: 100%;
  width: 100%;
  background: hotpink;
  }
.items{
  border: 5px solid;
  border-radius: 10px;
  font-size: 18px;
  width: 80%;
  padding: 10px;
  margin: 10px;
}
.btn1{
  background: skyblue;
  border: 5px solid black;
  border-radius: 20px;
  padding: 10px;
  float:right;
  margin: 2%;
  color: black;
  font-size:14px;
  font-weight: bold;
  }


</style>


Sunday, November 6, 2022

Divide Content on multiple pages in PHP : Paging in PHP

Some time we have a lot of data like 600000 records and we want to show them but not all at a time so we use paging to divide them on separate pages in this post i will define how to use paging in PHP.
First we have to create a Database.


Database Name:Paging

Table:


CREATE TABLE `record` (
 
`Id` int(9) NOT NULL,

`Name` varchar(100) NOT NULL,

`Mobno` int(18) NOT NULL,

`Address` varchar(100) NOT NULL

) ;

And We put Dummy data on 100 records in it .
Now Retrieve that data.i use limit property in my query like
SELECT id,name,mobno,address from record limit 0,6

it will limit data in only 6 rows.
Now by using String Query's i create a hyper links containing page no and then on page load get them and use in limit value .


Formula: ( page_no - 1 ) * 6


Query String: <a href='usman.php?page=".$s1."'>".$s1."</a>"


Get Request:if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 


Total Records:
$sql1 = "SELECT COUNT(id) FROM record"; 
$result1 = $conn->query($sql1); 
$getresult = $result1->fetch_assoc(); 
$total = $getresult["COUNT(id)"];
$s=$total/6;



CSS Code For Style:

<style>
  span{padding:10px;margin:10px;
  bottom: 5%;position: fixed;}
  span a{margin: 20px;border: 1px solid green;padding: 10px;}
body{background-color: #eae;}
div{margin:5px auto;width: 50%;border: 5px solid;
background-color: skyblue; padding: 10px;}
div table{margin: auto;}
div table td{border: 5px solid green;}
</style>


PHP Full Code:

<?php
include "conn.php";
echo '<h1 style="text-align:center;">Pagging in PHP</h1>';
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
$first = ($page-1) * 6;

$sql = "SELECT id,name,mobno,address from record limit $first,6" ;

$result = $conn->query($sql);

if ($result->num_rows > 0) {
while($row = $result->fetch_assoc())
 { 
echo "<div><table border=\"1\">";
echo    "<tr><th colspan=\"2\"width=200> Dummay Data For ".$row["id"]. "</th>";
echo    "<th rowspan=\"2\">";
echo    " Mobile No : ".$row["mobno"]."</th></tr>";
echo " <td>My Name: "  .$row["name"]. "</td>";
echo " <td>Yes My Name "  .$row["address"]. "</td></table></div>";
}} 

$sql1 = "SELECT COUNT(id) FROM record"; 
$result1 = $conn->query($sql1); 
$getresult = $result1->fetch_assoc(); 
$total = $getresult["COUNT(id)"];
$s=$total/6;
?>
<span>
<?php
for($s1=1;$s1<=$s;$s1++){
echo "<a href='usman.php?page=".$s1."'>".$s1."</a>";
}?>
</span>
<?php
$conn->close();
?>
 

Saturday, November 5, 2022

Ajax-Call : Password verification using ajax

Password verification using JavaScript-Ajax and HTML PHP.
To use this you have to include jQuery or use some jquery CDN and then create two file one for html code and other is for php and add the following code in and run on local host any one like xamp, wamp or some online server

Download Code

First for this we need an HTML file: say index.html

 paste following code in it:



<div>
<h1>The real password is admin</h1>

<input name="pass" type="password" id="pass"  placeholder="Enter any password">

<input type="button"  value="Check" onclick="check()">

</div>


Then the Java-Script code for this including Ajax is:



<script type="text/javascript">

function check(){
  var data = 'password='+document.getElementById('pass').value;
   obj={
    type:'post',
    data:data,
    url:'pass.php',
    success:function(msg){ alert(msg);      }
    };
   jQuery.ajax(obj);
 
 }
</script>


And the PHP code is. the php file name is pass.php:



<?php
extract($_REQUEST);

if($password==="admin"){
  
 echo "password matched";
  
}else{
 echo "password not matched";
  
}

?>

Friday, November 4, 2022

Thursday, November 3, 2022

Stylish Search bar example using jQuery

Stylish Search bar example using jQuery html and CSS it use jQueary online CDN for including jquery and use simple hide and show functions.

Download Code

Test here:




HTML Code:


<div class="main">
<img src="logo.png" id="display" />
<div class="search_bar" id="search">
<div class="box"><input type="text" placeholder="Search..." ></div>
<div class="btn"><input type="image" src="logo.png" alt="submit"></div>
</div>
</div>


JQuery Code:


<script>
$(document).ready(function(){
$("#display").click(function(){
$(this).hide();
$("#search").show();
});
$("#search").click(function(){
$(this).hide();
$("#display").show();
});
});
</script>


CSS code:


<style>
body{background-color:#eee;}
#display{height: 50px;width: 50px;border: 1px solid blue;border-radius: 10px;box-shadow: 2px 2px 10px skyblue;cursor:pointer;}
#search{padding: 10px;display: none;}
#search .box{float: left;}
#search input{height: 50px;box-shadow: 2px 2px 10px blue;}
#search input[type=image]{height: 42px;background-color: skyblue;border: 4px;border-style: solid;border-color: black;border-left: 0px;}
#search input[type=text]{padding: 12px;border: 4px;border-style: solid;border-color: black;border-right: 0px;}
.main{width:30%;margin:10% auto ;height:10%;box-shadow: 2px 2px 10px skyblue;padding:20px;background-color:#aaa;}
</style>

Wednesday, November 2, 2022

OnLine Doctor Appointment System Project in PHP - Programming seekerzZ

Read Also:  


OnLine Doctor Appointment System Project in PHP,HTML,CSS,Ajax


This is the complete PHP project on online doctor appointment system using PHP,HTML,Ajax,Javascript,CSS,Jquery and SQL .

To Download source code of Online Doctor Appointment System inbox me on Facebook.

Download From Here


https://www.facebook.com/usman.siddique.7771

OnLine Doctor Appointment System Project in PHP

Tuesday, November 1, 2022

Registration Form Using Div Elements in Html CSS

Read Also:  



CSS Code:

.heading{width: 30%;margin: auto;font-size:20px;font-family:arial;color:blue;}
input{padding: 1%;}
.main{border: 2px solid burlywood;width: 40%;margin: auto;padding: 2%;border-radius: 20px; }
.titles{float: left;width:50%;padding:3%;padding-left: 10%;font-size: 17px;}
.inputs{padding: 3%;}
.btn{margin: auto;width: 20%;padding: 3%;}
.botn{background-color: lightsteelblue;padding: 6%;border: 2px solid;border-radius: 10px;font-weight: bold;color: black;width:80%;}
body{background-color: #ddd;}


HTML Code:



<form action=" " method="get">

<div class="main">
<div class="heading">Registration Form</div>
<div class="titles"> First Name:  </div>
<div class="inputs"> <input type="text" >  </div>
<div class="titles"> Last Name:  </div>
<div class="inputs"> <input type="text" >  </div>
<div class="titles"> Father Name:  </div>
<div class="inputs"> <input type="text" >  </div>
<div class="titles"> Qualification:  </div>
<div class="inputs">  
           <select>
            <option>BSE</option><option>BSS</option><option>MSC</option>
            </select> 
       </div>
<div class="titles">  Gender: </div>
<div class="inputs"> 
<input type="radio" name="gnd" checked/>Male
<input type="radio" name="gnd"/>Female 
 </div>
<div class="titles"> Job Title:  </div>
<div class="inputs"> <input type="text" value="Android Develper" readonly/>  </div>
<div class="btn">  <input type="submit" value="Submit" class="botn"/> </div>
</div>

</form>