Skip to main content

Posts

Things to remember for creating secured password

Tips on how to create and remember your passwords Use the first letters of a sentence that you will remember,e.g. "I have 3 cats: Kitty, Pinky and Faggy" gives: Ih3c:KP&F, or Bouncing tigers have every right to ice-cream becomes: Bther2I-C. Take the name of the website and then add your personal twist, like your height or your friends home address (e.g. AmazonOceanRd). Avoid using your own contact details like your phone number or house number. Remove the vowels from a word or phrase e.g. "I like eating peanuts becomes: Ilktngpnts. Change your passwords at least every 60 days, cycling the numeric values up or down makes the new password easy to remember. Try copying and pasting at least some of the characters in your password that way key loggers wont be able to track your keystrokes. Use a phrase from your favourite book and then add the page, paragraph or chapter number. Mix letters, numbers and symbols, and use case sensitivity (upper and lower case ...

JS function to generate random number or random string

Javascript function to generate random number Javascript random number generation function is Math.random() alert(Math.random()); // returns number like 0.3871769046200184 The above JavaScript statement returns a random number between 0 and 1 ========================== ========================== var randnum=Math.floor(Math.random()*1001); This will generate a random number between 0 and 1001

Thumbnail creation on runtime php function

Function to create thumbnails of the images. this create thumbnails on runtime and will be displayed on browser. it accepts jpg,gif and png. the function is extendable. The function will generate thumbails of the images in the server or images from other domains. Save the following code as thumbimage.php the thumbnail generator is triggered by calling the page as thumbimage.php?src=sample.png where src is the image file name. In this example the src is passed as urlencoded string.

JS function to check the extension of file in the url

Javascript function to check the extension of file in the url. This is useful for setting filters for file control. the function and it sample use is given below: function checkFileType (str){ file_name=str.replace(/^.*(\\|\/|\:)/, ''); ext=file_name.split('.').pop().toLowerCase(); if( ext!= 'doc' && ext!= 'jpg' && ext!= 'jpeg' && ext!= 'png' && ext!= 'gif' && ext!= 'pdf'){ alert("Selected file "+file_name+" is invalid, Please upload file of type doc,jpg,jpeg,pdf,gif or png. "); document.getElementById('file').value=''; } } Sample usage <input id="file" name="file" onchange="javascript:checkFileType(this.value);" type="file" />

Dynamic control generation - Javascript code

The JS code for generating controls dynamically. Copy and paste the code and save it as an HTML file, take it on the browser to know the working of the script. The add Ctrl function will duplicate the TR of the table. On clicking the link "Add More Contact Persons" the new row of control will be created. On clicking the " Remove" link the corresponding row will be deleted.

JS function to convert string to US phone number format

Javascript function to change the string to US telephone number format Eg: if input string is 0115463234 ,it will be converted to (011)546-3234 function toPhoneFormat( obj ){ val=document.getElementById(obj).value; arrChars=val.split(''); formatedString=''; for(i=0;i < val.length;i++){ if(i==0) formatedString+='('; if(i==3) formatedString+=') '; if(i==6) formatedString+='-'; formatedString+=arrChars[i]; } document.getElementById(obj).value=formatedString; } Sample usage: Function is called in the onBlur event <input id="txtpersontel" type="text" name="persontel" maxlength="20" style="width:125px" onblur="toPhoneFormat('txtpersontel')" > Tweet


Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »
Member
Search This Blog