Posts

Showing posts from June, 2012

how to add value in array in php

How to Add more value in php array  <?php array_push (array  name  , value1,value2,value3,.... ); $ss =array();  // array declaration array_push ( $ss ,'val1' );   // array name , value ?>

how to add 30 days to a date in javascript

<script> function today(x){ y=parseInt(x); var d1=new Date((new Date()).getTime() + y*24*60*60*1000) ; var rr = d1.toString('yyyy-MM-dd'); a=rr.split(' '); d=a[2]+'-'+a[1]+'-'+a[3]; //return d ; alert(d); } </script> <input type="button" onclick="return today(0);" value="Today date"  /> <input type="button" onclick="return today(25);" value="NEXT 25 Days Date"  /> date picker in jquery   $( ".txtdate" ).datepicker({ changeMonth: true, changeYear: true }); $( ".txtdate" ).datepicker( "option", "dateFormat", "dd-M-yy");         $( ".txtdate" ).val(today('0')); 1. download necessary file from jquery  2. call txtdate class in input box

database connection in cakephp

database connection in cakephp 1. O pen app / config / database.php  <?php public $default  = array(          'datasource'  =>  'Database/Mysql' ,          'persistent'  =>  false ,          'host'  =>  'localhost' ,          'login'  =>  'user' ,          'password'  =>  '' ,  // here password          'database'  =>  'cakephp' ,  // its my database name          'prefix'  =>  '' ,          //'encoding' => 'utf8',      ); ?>

How To Use HTML Editor online

how to use html editor 1. download html editor from  http://nicedit.com/download.php 2.  copy and paste in a folder ,  Example: A   folder name 3. now create new folder within A  folder , Example : B     Folder name 4.   two file   nicEdit.js    and   nicEditorIcons.gif   (get from download)  paste on A folder 5. create demo.html file ,  on B  folder 6.   demo.html <script type="text/javascript" src="../nicEdit.js"></script> <script type="text/javascript"> // add text editor  bkLib.onDomLoaded(function(){ var myEditor = new nicEditor({fullPanel : true }).panelInstance('mytxtarea');   myEditor.addEvent('add', function() {   }); }); </script> <h4>Textarea</h4> <textarea name="area1" cols="40" id="mytxtarea" name="mytxtarea">     </textarea> 7.  how to get content from nicedit  function getcontain(){ var nicE = new nicEditors

php warning mail function.mail failed to connect to mailserver at localhost port 25

php warning mail function.mail failed to connect to mailserver at localhost port 25 php warning mail function.mail failed to connect to mailserver at localhost port 25 ini_set('SMTP' , 'Server address') how to find server address : open run and type :   ping www.google.in -t   // www.google.in your site address example : ini_set('SMTP' , '74.125.236.191')

how to create cookies in javascript

how to set cookie in javascript how to get cookie value in javascript <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script> function setCookie(){ document.cookie='mycookie';  alert('cookies Successfully set'); } function getCookie(){  var cv = document.cookie.split( ';');  alert(cv[0]);  // get cookies value } </script>  <input type="button" value="setCookie" onclick=" setCookie ();"  name="setcookie" />  <input type="button" name="getcookie" value="getcookie" onclick=" getCookie ();"  />

select only image file validation in javascript

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script> function imageOnly(){ var file = $('#txtfile').val(); ext = file.substr(file.lastIndexOf('.')+1); alert(ext); if(ext=='jpg' || ext=='png' || ext=='gif' || ext=='bmp' || ext=='tif' ){}else { alert('Please select only Image'); $('#txtfile').focus(); return false ;} } </script> <input type="file" name="txtfie" id="txtfile"  />  <input type="button" value="Upload File" onclick="return imageOnly();"  />

wordpress theme development tutorial

wordpress theme development tutorial http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-wordpress-theme-from-scratch/

wordpress plugin development tutorial

wordpress plugin development tutorial http://corpocrat.com/2009/12/27/tutorial-how-to-write-a-wordpress-plugin/

case when then in mysql

gender = column name table = table name SELECT * , CASE   gender when 'm' then 'male'               when 'f' then 'Female'   else gender END as ty FROM  Table SELECT * , CASE  when   id > 5   then 'male'               when   id < 5   then 'Female'   else gender  END as ty FROM  Table

how to auto close alert box javascript

how to auto close alert box javascript how to auto close alert box javascript I am also searching this code , if you found please comment code here thanks 

date format in javascript dd mmm yyyy

 date format in javascript dd mmm yyyy   <script type="text/javascript"> function todayDate(){ var d1=new Date(); var rr = d1.toString('yyyy-MM-dd'); a=rr.split(' '); d=a[2]+'-'+a[1]+'-'+a[3]; //return d ; alert(d); } </script> <input type="button" name=" Check " onclick="todayDate()" value="click"  />

number to word conversion in javascript

how to add value one select box to another select box

Select Branch : --- Select branch --- --- branch 1--- --- branch 2--- --- branch 3--- --- branch 4--- <script> function addSrcToDestListM() {  ddlbranch = window.document.formmanage.ddlbranch;  // form name.slelect id ddlbranch1 = window.document.formmanage.ddlbranch1; var len = ddlbranch.length;  // alert(len); for(var i = 0; i < ddlbranch1.length; i++) { if ((ddlbranch1.options[i] != null) && (ddlbranch1.options[i].selected)) { var found = false; for(var count = 0; count < len; count++) { if (ddlbranch.options[count] != null) { if (ddlbranch1.options[i].text == ddlbranch.options[count].text) { found = true; break;       }    } } if (found != true) { ddlbranch.options[len] = new Option(ddlbranch1.options[i].text,ddlbranch1.options[i].value); len++;          }       }    } var ddlbranchx  = window.document.formmanage.ddlbranch; var lenx = ddlbranchx.op

on click null inputbox using javascript

<input type="text" name="txtcity" id="txtcity" style="float:left; width:70px ; margin-right:5px;color: rgb(204, 204, 204); " value="City" onFocus="if (this.value == 'City'){this.value='';this.style.color='#000000';}" onBlur="if (this.value == ''){this.value='City';this.style.color='#cccccc';}"   />

mp govt jobs in bhopal

 are you searching government job in mp   . there are two place where you find government job in mp . 1.  http://www.mpinfo.org/ 2.  http://www.vyapam.nic.in/e_default.htm There are many site who is provide the information about  government job in India  such as http://www.freejobalert.com/ http://jobs.freshersworld.com/jobs and other

how to get top 3 records in sql

how to get top 3 records in sql   , or   how to get top 3 (RECENT ) record from mysql query : SELECT  * FROM TABL_NAME ORDER BY ID DESC LIMIT 0,3  how to update multiple rows in mysql with one query with different values UPDATE `tbname` SET `column_name` = CASE  `id` WHEN '1' THEN '1' WHEN '2' THEN '2' WHEN '3' THEN '3' END