Thursday, 25 December 2014

Mail Function in PHP

mail.php

<?php
ob_start();



$email = trim($_GET['j_email']);


$support_address = "rajkumarsahoo@yahoo.com"; //Your Company Email ID//

$headers2 = "From: ".$support_address;

if ( $email == "" )

{
echo "Name is empty";
}
else
{

// Your Auto Replay Message//
mail($email,"Thank You For Contact ","Thank You We Will Contact You Shortly");
//unset($email);
echo "<script>
                                                          window.location.href = 'contact_full.php';
                                                          </script>";
}

?>

Create Process Bar Like Gmail In HTML

index.html

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>DEMO - Gmail like progress bar with CSS and jQuery</title>
<script type='text/javascript'
src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<style>
body {
background: rgb(245, 245, 245);
}

.g-div {
position: absolute;
top: calc(50% -   6px);
left: calc(50% -   160px);
text-align: center;
width: 320px;
font-weight: bold;
}

.loader-gmail {
padding: 1px;
overflow: hidden;
border: 1px solid #a4a4a4;
}

.progress {
width: 320px;
height: 8px;
background-image: linear-gradient(135deg, #6187f2 0%, #6187f2 25%, #5679da 25%, #5679da
50%, #6187f2 50%, #6187f2 75%, #5679da 75%, #5679da 100%);
background-repeat: repeat;
background-position: 0px 0px;
background-size: 16px 16px;
background-clip: content-box;
animation: loading 1s linear infinite;
-o-animation: loading 1s linear infinite;
-moz-animation: loading 1s linear infinite;
-webkit-animation: loading 1s linear infinite;
}

@keyframes loading {
    from {
      background-position:0px 0px;
    }
    to {
 background-position: -16px 0px;
    }
}
@-webkit-keyframes loading {
    from {
      background-position:0px 0px;
    }
    to {
 background-position: -16px 0px;
    }
}
@-moz-keyframes loading {
    from {
      background-position:0px 0px;
    }
    to {
 background-position: -16px 0px;
    }
}
@-o-keyframes loading {
    from {
      background-position:0px 0px;
    }
    to {
 background-position: -16px 0px;
    }
}
</style>

<script>
    var p=0;
    function timeout_trigger() {
  $(".progress").css("max-width",p+"%");
  $(".progress-view").text(p+"%");
  if(p!=100) {
  setTimeout('timeout_trigger()', 50);
  }
  p++;
}
    timeout_trigger();
  </script>
</head>
<body>
<div style="width:730px;margin:auto">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- demos -->
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-4537529140156254"
     data-ad-slot="4444050329"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>

<div class="g-div">
Loading <span class="progress-view">0%</span>
<div class="loader-gmail">
<div class="progress"></div>
</div>
</div>


</body>


</html>

Create Dynamic URL in jsp

1.index.jsp page

<html>
  <head>
    <title>the c:url action (1)</title>
  </head>
  <body>
    This page takes 3 values that you specify, and forwards them to another JSP.
    That JSP will create a URL to another page, that then extracts the
    parameters and displays them.
    <p />
      <form action="createURL.jsp" method="post">
        <table>
          <tr><td>Enter name:</td>
              <td><input type="text" name="name"   /></td></tr>
          <tr><td>Enter age:</td>
              <td><input type="text" name="age"    /></td></tr>
          <tr><td>Enter gender:</td >
              <td><input type="text" name="gender" /></td></tr>
        </table>
        <input type="submit" value="Submit details" />
      </form>
  </body>

</html>


2. createURL.jsp

<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>

<c:url value="displayValues.jsp" var="displayURL">
  <c:param name="nameParam"   value="${param.name}" />
  <c:param name="ageParam"    value="${param.age}" />
  <c:param name="genderParam" value="${param.gender}" />
</c:url>

<html>
  <head>
    <title>the c:url action (2)</title>
  </head>
  <body>
    This page receives the values you specified, and creates a URL that contains
    them.
    <p />
    The generated URL is <c:out value="${displayURL}" />. <p/>
    Click <a href='<c:out value="${displayURL}" />'>here</a> to view the it.
  </body>

</html>

3.displayValues.jsp

<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>

<html>
  <head>
    <title>the c:url action (3)</title>
  </head>
  <body>
    <h3>List of query string parameters:</h3>
    <ul>
      <c:forEach items="${param}" var="currentParam">
        <li><c:out value="${currentParam.key}" />
            = <c:out value="${currentParam.value}" /></li>
      </c:forEach>
    </ul>
 </body>
</html>