function generate_password( $length = 8 ) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $password = substr( str_shuffle( $chars ), 0, $length ); return $password; }
Html, JAVA,DOTNET,Javascript, PHP, and JQuery Scripts and its issues with solutions
Saturday, 28 June 2014
How to generate passoword in php with specific length?
How to get n digit random numers in php?
function generate_number_code( $length = 8 ) { $chars = "0123456789"; $password = substr( str_shuffle( $chars ), 0, $length ); return $password; }
JS get random Numbers
function getRandom(length) { var rand = Math.floor(Math.pow(10, length-1) + Math.random() * 9 * Math.pow(10, length-1)); return rand; }
PHP - Mysql Get date between two date ranges
Fetching records between two date ranges
Between two years SELECT * FROM `dt_tb` WHERE year( dt2 ) between 2004 and 2005 Between two month ranges. SELECT * FROM `dt_tb` WHERE month(dt) between '02' and '08' SELECT * FROM `dt_tb` WHERE month(dt) between '02' and '08' and year(dt) between 2004 and 2005 Between two date ranges SELECT * FROM `dt_tb` WHERE dt BETWEEN '2005-01-01' AND '2005-12-31'
PHP - Header redirect issue Occur in Live Server
Method I
<?php ob_start(); if(isset($_GET['elimina_id'])){ if (in_array($_GET['elimina_id'], $_SESSION['cart']) ) { $index = (array_keys($_SESSION['cart'], $_GET['elimina_id'])); $i = $index[0]; unset($_SESSION['cart'][$i]); header('location: cart.php'); } } ob_end_flush(); ?>
Method II
HTML: <meta http-equiv="refresh" content="0;url=http://www.site.com/cart.php"> JavaScript #1: <script>window.location = "http://www.site.com/cart.php";</script> JavaScript #2: <script>window.navigate("http://www.site.com/cart.php");</script>
Wednesday, 25 June 2014
Set Position of Bootstrap Modal Popup
@media screen and (min-width: 768px) { .modal-dialog { left: 50%; right: auto; width: 624px; } } .modal-dialog{ position: absolute; left: 50%; //now you must set a margin left under zero - value is a half width your window margin-left: -312px; // this same situation is with height - example height: 500px; top: 50%; margin-top: -250px; }
Alphanumeric Validation
Enter text filed only to allow alphabit & Numbers function alpha_numeric_validation(arg){ var valReg = /^[A-Za-z0-9]+$/; if(valReg.test( arg ) ) { return false; } else { return true; } }
Subscribe to:
Posts (Atom)
Feet/Inches to Meters Converter & Lbs to Kgs Converter
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Feet/Inches ⇄...
-
<?php $to = "somebody@example.com, somebodyelse@example.com"; $subject = "HTML email"; $message = " <h...
-
document.onkeydown = myKeyDownHandler; function myKeyDownHandler(event){ alert(event.keyCode) }
-
In php page change execution tin in php.ini file max_execution_time = 100;