Posts

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 ge...

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();"  />