Skip to main content

Posts

Showing posts from 2017

password validation

 <form method="post" action="new_pass_code.php" role="login">           <img src="assets/img/imgpsh_fullsize.png" class="img-responsive" alt="" style="width:90%;"/>  Enter New Password            <input type="password" id="txtPassword" name="newpass" required/>           Confirm New Password           <input type="password" id="txtConfirmPassword" required/>            <input type="submit" id="btnSubmit" value="Submit" onclick="return Validate()" />           <div>           </div>                   </form> <script type="text/javascript">     function Validate() {         var password = document.getElementById("txtPassword").value;   ...

multiple image upload

 <form  action="a_add_image_code.php" method="POST"  enctype="multipart/form-data">                     <div class="control-group form-group">                         <div class="controls">                             <label>Upload</label>                           <input type="file" name="files[]" multiple required>                         </div>                     </div>                     <input type="submit" class="btn btn-primary" value="Submit" name="submit">             ...

Working Pagination PHP code

<? php // Custom PHP MySQL Pagination Tutorial and Script // You have to put your mysql connection data and alter the SQL queries(both queries) mysql_connect ( "DATABASE_Host_Here" , "DATABASE_Username_Here" , "DATABASE_Password_Here" ) or die ( mysql_error ()); mysql_select_db ( "DATABASE_Name_Here" ) or die ( mysql_error ()); ////////////// QUERY THE MEMBER DATA INITIALLY LIKE YOU NORMALLY WOULD $sql = mysql_query ( "SELECT id, firstname, country FROM myTable ORDER BY id ASC" ); //////////////////////////////////// Pagination Logic //////////////////////////////////////////////////////////////////////// $nr = mysql_num_rows ( $sql ); // Get total of Num rows from the database query if ( isset ( $_GET [ 'pn' ])) { // Get pn from URL vars if it is present $pn = preg_replace ( '#[^0-9]#i' , '' , $_GET [ 'pn' ]); // filter everything but numbers for security(new) //$p...

embed play youtube video just from url

<? $videolink='https://www.youtube.com/watch?v=6SDlG8T2KRE'; $ytarray=explode("/", $videolink); $ytendstring=end($ytarray); $ytendarray=explode("?v=", $ytendstring); $ytendstring=end($ytendarray); $ytendarray=explode("&", $ytendstring); $ytcode=$ytendarray[0]; echo "<iframe width=\"420\" height=\"315\" src=\"http://www.youtube.com/embed/$ytcode\" frameborder=\"0\" allowfullscreen></iframe>"; ?>

share facebook, twitter, google+, Email

  <iframe src="https://www.facebook.com/plugins/share_button.php?href=<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" width="77" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe> <a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" data-size="large" target="_blank">Tweet</a> <a href="https://plus.google.com/share?url=<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" onClick="renderWidget();">Google+</a> <a href="mailto:?subject=I wanted you to see this Link&amp;body=Check out this site <?p...

bootstrap slider back to top

<script src = "//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" > </script> <link rel = "stylesheet" id = "font-awesome-css" href = "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" type = "text/css" media = "screen" > copy anywhere in your page <div class="scroll-top-wrapper "> <span class="scroll-top-inner"> <i class="fa fa-2x fa-arrow-circle-up"></i> </span> </div> <style> .scroll-top-wrapper {     position: fixed; opacity: 0; visibility: hidden; overflow: hidden; text-align: center; z-index: 99999999;     background-color: #2E9BDC; color: #eeeeee; width: 50px; height: 48px; line-height: 48px; right: 30px; bottom: 30px; padding-top: 2px; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-rad...

get current date and furter php

echo $startdate1=date("d-m-Y").'<br>'; $parts = explode('-',$startdate1); echo $startdate2 = date('d-m-Y',mktime(0,0,0,$parts[1],($parts[0]+1),$parts[2])); echo $startdate3 = date('d-m-Y',mktime(0,0,0,$parts[1],($parts[0]+2),$parts[2])); echo $startdate4 = date('d-m-Y',mktime(0,0,0,$parts[1],($parts[0]+3),$parts[2])); echo $startdate5 = date('d-m-Y',mktime(0,0,0,$parts[1],($parts[0]+4),$parts[2])); echo $startdate6 = date('d-m-Y',mktime(0,0,0,$parts[1],($parts[0]+5),$parts[2])); echo $startdate7 = date('d-m-Y',mktime(0,0,0,$parts[1],($parts[0]+6),$parts[2]));

dropdown with checkbox and insert multiple checkbox

works only in bootstrap <div class="button-group"> <button type="button" class="btn btn-default btn-sm dropdown-toggle form-control" data-toggle="dropdown"> Select Country <span class="caret"></span> </button> <ul class="dropdown-menu form-control" style="height:160px; overflow-x: hidden;"> <? $sql="SELECT * from country"; $result=mysqli_query($con,$sql); if(mysqli_num_rows($result)>0) { while($row=mysqli_fetch_assoc($result)) { ?> <li class="form-control"> <input type="checkbox" value="<? echo $row['country_name'];?>" name ="chk[]"/>&nbsp;<? echo $row['country_name'];?></li> ...