Saturday, 13 June 2020

Simple blog in php with source code

Simple blog in php with source code for basic leaning for blog creation  you can download the code  Below


Friday, 8 November 2019

responsive Login form in html code


 Responsive Login form in html  code


Index.html 



<!DOCTYPE html>
<html >
<head>
  <meta charset="UTF-8">
  <title>Login Form</title>



      <link rel="stylesheet" href="css/style.css">


</head>

<body>
  <body>
<div class="login">
<div class="login-screen">
<div class="app-title">
<h1>Login</h1>
</div>

<div class="login-form">
<div class="control-group">
<input type="text" class="login-field" value="" placeholder="username" id="login-name">
<label class="login-field-icon fui-user" for="login-name"></label>
</div>

<div class="control-group">
<input type="password" class="login-field" value="" placeholder="password" id="login-pass">
<label class="login-field-icon fui-lock" for="login-pass"></label>
</div>

<a class="btn btn-primary btn-large btn-block" href="#">login</a>
<a class="login-link" href="#">Lost your password?</a>
</div>
</div>
</div>
</body>


</body>
</html>




style.css



* {
box-sizing: border-box;
}

*:focus {
outline: none;
}
body {
font-family: Arial;
background-color: #3498DB;
padding: 50px;
}
.login {
margin: 20px auto;
width: 300px;
}
.login-screen {
background-color: #FFF;
padding: 20px;
border-radius: 5px
}

.app-title {
text-align: center;
color: #777;
}

.login-form {
text-align: center;
}
.control-group {
margin-bottom: 10px;
}


input {
text-align: center;
background-color: #ECF0F1;
border: 2px solid transparent;
border-radius: 3px;
font-size: 16px;
font-weight: 200;
padding: 10px 0;
width: 250px;
transition: border .5s;
}

input:focus {
border: 2px solid #3498DB;
box-shadow: none;
}

.btn {
  border: 2px solid transparent;
  background: #3498DB;
  color: #ffffff;
  font-size: 16px;
  line-height: 25px;
  padding: 10px 0;
  text-decoration: none;
  text-shadow: none;
  border-radius: 3px;
  box-shadow: none;
  transition: 0.25s;
  display: block;
  width: 250px;
  margin: 0 auto;
}

.btn:hover {
  background-color: #2980B9;
}

.login-link {
  font-size: 12px;
  color: #444;
  display: block;
margin-top: 12px;
}

sliding form development sample


sliding form development sample

slider.html




<html>
<head>

<meta name="robots" content="noindex, nofollow">

<!-- include css file here-->
<link rel="stylesheet" href="css/style.css"/>

    <!-- below line is used for google font-->
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>

<script src="js/slider.js"></script>
</head>

<body>

<!-- advertising div -->
<div class="formget">


<!-- Sliding div starts here -->
<div id="slider" style="right:-342px;">
<div id="sidebar" onclick="open_panel()">
<img src="images/contact.png"/>
</div>
<div id="header">

<h2>Contact Form</h2>
<input type="text" name="dname" value="Your Name"/>
<input type="text" name="demail" value="Your Email"/>
<h4>Query type</h4>
<select>
        <option>General</option>
<option>Presales</option>
<option>Technical</option>
<option>Others</option>
</select>

<textarea type="text" value="message">Message</textarea><br/>
<button>Send Message</button>

</div>
</div>
<!-- Sliding div ends here -->
</body>

</html>


style.css




body{
overflow:hidden;
width:960px;
margin:10px auto;
}

p{
border-bottom: 1px dotted #d8d8d8;
padding-bottom: 15px;
font-size:17px;
}

#slider{
width:500px;
top:100px;
position:absolute;
}
 
#header{
width:260px;
height:520px;
position:absolute;
right:0px;
border:1px solid #d8d8d8;
margin-left:40px;
padding:20px 40px;
border-radius:3px;
box-shadow: 0 0 8px gray;
}


#sidebar{
position:absolute;
top:180px;
left:113px;
box-shadow: 0 0 8px gray;
}

#sidebar1{

position:absolute;
top:180px;
left:113px;
box-shadow: 0 0 8px gray;
}


h3{
font-family: 'Roboto Slab', serif;
}

input[type=text]{
margin-top: 10px;
padding:6px;
width:100%;
font-size:15px;
border-radius:2px;
border:3px solid #98d0f1;
}

h4{
font-size:15px;
}
div#title{
position:absolute;
top:300px;
left:650px;
}

select{
padding:6px;
width:100%;
font-size:15px;
border-radius:2px;
border:3px solid #98d0f1;
}

textarea{
padding:6px;
font-size:15px;
border-radius:2px;
border:3px solid #98d0f1;
margin-top: 10px;
height:80px;
width:100%;
}

button{
background:#2bc1f2;
border: none;
color: #fff;
width: 100%;
font-size: 22px;
font-weight: bolder;
padding: 8px 0 8px 0;
border-radius: 3px;
cursor: pointer;
margin-top:25px;
}

slider.js



function open_panel()
{
slideIt();
var a=document.getElementById("sidebar");
a.setAttribute("id","sidebar1");
a.setAttribute("onclick","close_panel()");
}

function slideIt()
{
var slidingDiv = document.getElementById("slider");
var stopPosition = 0;

if (parseInt(slidingDiv.style.right) < stopPosition )
{
slidingDiv.style.right = parseInt(slidingDiv.style.right) + 2 + "px";
setTimeout(slideIt, 1);
}
}

function close_panel(){
slideIn();
a=document.getElementById("sidebar1");
a.setAttribute("id","sidebar");
a.setAttribute("onclick","open_panel()");
}

function slideIn()
{
var slidingDiv = document.getElementById("slider");
var stopPosition = -342;

if (parseInt(slidingDiv.style.right) > stopPosition )
{
slidingDiv.style.right = parseInt(slidingDiv.style.right) - 2 + "px";
setTimeout(slideIn, 1);
}


}


send email contact form detail in php

send email contact form detail

index.php




<?php
//index.php

$count = 0;
$error = '';
if(isset($_POST['submit']))
{
$name = '';
$phone = '';
$email = '';
$address = '';
if(empty($_POST['name']))
{
$error .= '<p class="text-danger">Name is Required</p>';
}
else
{
if(!preg_match("/^[a-zA-Z ]*$/",$_POST["name"]))
{
$error .= '<p class="text-danger">Only Alphabet allowed in Name</p>';
}
else
{
$name = $_POST['name'];
}
}

if(empty($_POST["email"]))
{
$error .= '<p class="text-danger">Email Address is Required</p>';
}
else
{
if(!filter_var($_POST["email"], FILTER_VALIDATE_EMAIL))
{
$error .= '<p class="text-danger">Invalid email format</p>';
}
else
{
$email = $_POST["email"];
}
}

if(empty($_POST["phone"]))
{
$error .= '<p class="text-danger">Phone Number is Required</p>';
}
else
{
if(!preg_match("/^[0-9]*$/",$_POST["phone"]))
{
$error .= '<p class="text-danger">Only Numbers allowed in Phone</p>';
}
else
{
$phone = $_POST["phone"];
}
}

if(empty($_POST["address"]))
{
$error .= '<p class="text-danger">Address is Required</p>';
}
else
{
$address = $_POST["address"];
}

if($error == '')
{
$count = $count + 1;
$error = '<label class="text-success">Form Data Submitted</label>';
}


}

?>
<!DOCTYPE html>
<html>
<head>
<title>How to Restore Form Data using Jquery with PHP</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="savy.js"></script>
</head>
<body>
<br />
<h2 align="center"><a href="#">How to Restore Form Data using Jquery with PHP</a></h2>
<br />
<div class="container">
<div class="row">
<div class="col-lg-6" style="margin:0 auto; float:none;">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">User Form</h3>
</div>
<div class="panel-body">
<form method="post">
<span class="text-danger"><?php echo $error; ?></span>
<div class="form-group">
<label>Name</label>
<input type="text" name="name" id="name" class="form-control" />
</div>
<div class="form-group">
<label>Email</label>
<input type="text" name="email" id="email" class="form-control" />
</div>
<div class="form-group">
<label>Phone</label>
<input type="text" name="phone" id="phone" class="form-control" />
</div>
<div class="form-group">
<label>Address</label>
<textarea name="address" id="address" class="form-control"></textarea>
</div>
<div class="form-group">
<label>Gender</label>
<select name="gender" id="gender" class="form-control">
<option value="male">Male</option>
<option value="female">Female</option>
</select>
</div>
<div class="form-group">
<label>Programming Languages</label><br />
<div class="checkbox-inline">
<label><input type="checkbox" name="languages[]" id="php_language" value="PHP">PHP</label>
</div>
<div class="checkbox-inline">
<label><input type="checkbox" name="languages[]" id="java_language" value="Java">Java</label>
</div>
<div class="checkbox-inline">
<label><input type="checkbox" name="languages[]" id="net_language" value=".Net">.Net</label>
</div>
</div>
<div class="form-group" align="center">
<input type="submit" name="submit" class="btn btn-info" value="Submit" />
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

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

<?php
if($count == 0)
{
?>
$('#name').savy('load');
$('#email').savy('load');
$('#phone').savy('load');
$('#address').savy('load');
$('#gender').savy('load');
$('#php_language').savy('load');
$('#java_language').savy('load');
$('#net_language').savy('load');
<?php
}
else
{
?>
$('#name').savy('destroy');
$('#email').savy('destroy');
$('#phone').savy('destroy');
$('#address').savy('destroy');
$('#gender').savy('destroy');
$('.languages').savy('destroy');
$('#php_language').savy('destroy');
$('#java_language').savy('destroy');
$('#net_language').savy('destroy');
<?php
}
?>

});

</script>



mail.html


<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {font-family: Arial, Helvetica, sans-serif;}

input[type=text], select, textarea {
    width: 100%;
    padding: 12px;

    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 16px;
    resize: vertical;
}

input[type=submit] {
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type=submit]:hover {
    background-color: #45a049;
}

.container {
    border-radius: 5px;
    background-color: #f2f2f2;
    padding: 20px;
}
</style>
</head>
<body>

<h3>Contact Form</h3>

<div class="container">
  <form action="www.bhagyawebtechnologies.in/sendmail.php">
    <label for="fname">First Name</label>
    <input type="text" id="fname" name="firstname" placeholder="Your name..">

    <label for="lname">Last Name</label>
    <input type="text" id="lname" name="lastname" placeholder="Your last name..">
    <label for="lname">email</label>
    <input type="text" id="email" name="email" placeholder="Your last name..">
<label for="lname">telephone</label>
    <input type="text" id="telephone" name="telephone" placeholder="Your last name..">
    <label for="country">Country</label>
    <select id="country" name="country">
      <option value="australia">Australia</option>
      <option value="canada">Canada</option>
      <option value="usa">USA</option>
    </select>

    <label for="comments">Subject</label>
    <textarea id="comments" name="comments" placeholder="Write something.." style="height:200px"></textarea>

    <input type="submit" value="Submit">
  </form>
</div>

</body>
</html>



sendmail.php




<?php
if(isset($_POST['email'])) {
    // EDIT THE 2 LINES BELOW AS REQUIRED
    $email_to = "abc@gmail.com";
    $email_subject = "Meet Now";
   function died($error) {
        // your error code can go here
        echo "but there were error found with the form you submitted. ";

        echo $error."<br /><br />";
        echo "Please go back and fix these errors.<br /><br />";
        die();
    }
    // validation expected data exists
    if(!isset($_POST['fname]) ||
        !isset($_POST['lname']) ||
        !isset($_POST['email']) ||
        !isset($_POST['telephone']) ||
        !isset($_POST['country']) ||
    
        !isset($_POST['comments'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');       
    }
     
    $fname = $_POST['fname']; // required
    $lname = $_POST['lname']; // required
    $email_from = $_POST['email']; // required
    $telephone = $_POST['telephone']; // not required
        $country = $_POST['country']; // not required
         
    $comments = $_POST['comments']; // required
    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
  }
    $string_exp = "/^[A-Za-z .'-]+$/";
  if(!preg_match($string_exp,$fname)) {
    $error_message .= 'The First Name you entered does not appear to be valid.<br />';
  }
  if(!preg_match($string_exp,$lname)) {
    $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
  }
  if(strlen($comments) < 0) {
    $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  }
  if(strlen($error_message) > 0) {
    died($error_message);
  }
    $email_message = "Meet Now details below.\n\n";
     
    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    }
     
    $email_message .= "Name: ".clean_string($fname)."\n";
    $email_message .= "city: ".clean_string($lname)."\n";
    $email_message .= "Email: ".clean_string($email_from)."\n";
    $email_message .= "Mobile: ".clean_string($telephone)."\n";
    $email_message .= "Date: ".clean_string($country)."\n";
   
        
    $email_message .= "Comments: ".clean_string($comments)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);  
?>
 <!-- include your own success html here -->
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Welcome to Shaadiclubs.com -Wedding serv</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <style>
    /* Remove the navbar's default margin-bottom and rounded borders */ 
    .navbar {
      margin-bottom: 0;
      border-radius: 0;
background-color: white;  
  text color: #EC2B2E;
    }
li:hover {background: #E72E5B;}
  
  
  body {
      position: relative; 
  height: 100%;
  }

  #Why{padding-top:50px;height:500px;color: #fff; background-color: ;}
  #Service {padding-top:50px;height:500px;color: #fff; background-color: ;}
  #Vendor {padding-top:50px;height:900px;color: #fff; background-color: ;}
  #Testimoinal {padding-top:50px;height:500px;color: #fff; background-color: ;}
    
    /* Add a gray background color and some padding to the footer */
    footer {
      background-color: #f2f2f2;
      padding:32px;
    }
    
  .carousel-inner img {
      width: 100%; /* Set width to 100% */
      margin: auto;
      min-height:200px;
  }

  /* Hide the carousel text when the screen is less than 600 pixels wide */
  @media (max-width: 600px) {
    .carousel-caption {
      display: none; 
    }
  }
  footer {
      background-color: #E72E5B;
      color: #f5f5f5;
      padding: 20px;
  }
  footer a {
      color: #f5f5f5;
  }
  footer a:hover {
      color: #777;
      text-decoration: none;
  }  
input[type=text]:focus, input[type=password]:focus {
    background-color: #161515;
    outline: none;
}
a {
    color: #EF2D30;
}
  
/* Set a style for the submit button */
.btn {
    background-color: #F1AE34;
    color: white;
    padding: 8px 10px;
    border: none;
    cursor: pointer;
    width: 25%;
    opacity: 0.9;
}
  
  </style>
</head>
<body>
<?php include('includes/header.php');?>
</br></br></br></br></br></br></br></br></br></br></br></br></br></br></br>
<b><font size="5">
Thank you for contacting us. We will be in touch with you very soon.</b></font>
<?php
}
?>


  </div>
    </div>
  </div>
</div>

    </div>
  </div>


</div>
</br></br></br></br></br></br></br></br></br></br></br></br></br></br></br></br></br></br></br></br>
<?php include('includes/footer.php');?>


  

  
</body>
</html>


Captions, Table Headers, and Table Data use in html

To round out your tables, you have the other basic tags to examine. You've already successfully used <CAPTION><TH>, and <TD>, but each has its own attributes and abilities that you need to know about.

<CAPTION>

The <CAPTION> tag is a container for reasons that may be obvious-it allows you to nest other HTML tags within the description. For instance:

<CAPTION><B>Table 3.1 from the book <I>Life in El Salvador</I></B></CAPTION>
Just about any sort of markup tags are possible inside the <CAPTION> tags, although some-like list tags-wouldn't make much sense.
The <CAPTION> tag has one attribute, ALIGNALIGN="TOP" and ALIGN="BOTTOM" are encouraged. By default, text is also aligned to center (horizontally). By TOP and BOTTOM, I'm referring to the entire table; the caption will default to the top of the table if not otherwise specified. To align the caption to BOTTOM, for instance, enter the following:
<CAPTION ALIGN="BOTTOM">Table of Common Foods</CAPTION>
The <CAPTION> tag is commonly the first tag just inside the <TABLE> tag (although this placement is not required). Regardless of where you place the <CAPTION> tag, however, you must use ALIGN to force it to the bottom of the table. Otherwise, it will appear at the top, according to its default.
Let's create an entire table and use the ALIGN attribute to the <CAPTION> tag to force the caption to the bottom, like this:

<BODY><H3>Favorite Ice Cream Flavors</H2><TABLE BORDER><CAPTION ALIGN="BOTTOM">Data from the <I>New Jersey Times</I></CAPTION><TR><TH>Date</TH><TH>Chocolate</TH><TH>Vanilla</TH> <TR><TH>1970</TH><TD>50%</TD><TD>50%</TD> <TR><TH>1980</TH><TD>76%</TD><TD>24%</TD> <TR><TH>1990</TH><TD>40%</TD><TD>60%</TD> </TABLE></BODY>

When the browser interprets this table, it should place the caption at the bottom of the table, centered horizontally



Table Rows




Table rows (<TR>) can accept one attribute you should concern yourself with-ALIGN. The ALIGN attribute is used to determine how text will appear (horizontally) in each of the rows data cells. For example:

<TR ALIGN="CENTER"><TH>Date</TH><TH>Chocolate</TH><TH>Vanilla</TH> <TR ALIGN="CENTER"><TH>1970</TH><TD>50%</TD><TD>50%</TD> <TR ALIGN="CENTER"><TH>1980</TH><TD>76%</TD><TD>24%</TD> <TR ALIGN="CENTER"><TH>1990</TH><TD>40%</TD><TD>60%</TD>



Table Data and Rows



Aside from accepting nearly any type of HTML markup tags within them, both tags can accept four attributes (in most HTML versions). These are ALIGNVALIGNCOLSPAN, and ROWSPAN. If you were to add all of these attributes, a typical <TH> (or <TD>) tag would be formatted like the following:
<TH ALIGN="direction" VALIGN="direction" COLSPAN="number" ROWSPAN="italics">
ALIGN is used to align the data within the cell horizontally, accepting values of LEFTRIGHT, and CENTER. Note that ALIGN is redundant when used with the ALIGN attribute of <TR>, unless it is used to override the <TR ALIGN=> setting.
VALIGN is used to align the data vertically within cells. Possible values are TOPBOTTOM, and CENTERCOLSPAN and ROWSPAN are used to force a cell to span more than one column or row, respectively. An example of this might be:

<TABLE BORDER><TR><TH>Student</TH><TH>Test 1</TH><TH>Test 2</TH><TH>Average</TH><TR><TH>Mike M.</TH><TD>100</TD><TD>75</TD><TD ROWSPAN="3">N/A</TD><TR><TH>Susan T.</TH><TD>80</TD><TD>95</TD> <TR><TH>Bill Y.</TH><TD COLSPAN="2">Dropped Course</TD></TABLE>