New Interview Questions

1. how to get the ip address. 2. diff. b/w echo,print, print_r. 3. ftp php (how we connect to ftp)(ans: ftp_connect() “Opens an FTP connection”) 4. paypal 5. php oops 6. pconnect, connect 7. Explain join queries 8. Example of Join Query(join,left,right) 9. step of joomla template 10. function overriding and overloading. 11. array merge … Read more

Categories PHP

ExtJs dataview refresh problem

[code]Ext.getCmp(dataview id).getStore().load({params:{}}); or Ext.getCmp(dataview id).getStore().reload();[/code] By using this code your dataview automatically be refreshed. [html]NOTE: The response only come in the pure json format[/html] If you will use this in PHP for fetching the data for dataview you must declare $json_data[‘templateItems’][]= $row; in case of no result found. Otherwise your data view not working correctly. … Read more

paging in PHP

$count_rec=400; //give here the total number of records if($count_rec>0) { $total_pages=ceil($count_rec/20); $page=$_REQUEST[‘page’]; $start=($page-1)*20+1; $end=$start+19; $x=$start; //foreach ($photosetList[photoset] as $setList) { //$sizes = $f->photos_getSizes($setList[primary]); if($end%$x<=19) { echo “”; } //} } echo ” “; if($end>$count_rec) { $end=$count_rec; } if($page==1) { echo “<<“; }else { $back=$page-1; ?> <a href=”pagingPhp.php?page=”><<<</a> $val=ceil($count_rec/20); echo “Page :- “.$_REQUEST[‘page’]; if($page==$val) { echo … Read more

Categories PHP

How to decode json response in ExtJs

//when json response is in this format {“success”:true,”data”:{“id”:11}} Ext.Ajax.request({ url:’connect.php’, params:{moduleId:moduleId, status:’insert’,activity:’save’,action:’doAction’}, success:function(res){ var response = Ext.util.JSON.decode(res.responseText); alert(response.data.id); } });

How to increase your session time out PHP

$values = $_SESSION; // keep session config $trans = ini_get( ‘session.use_trans_sid’ ); if( $trans ) { ini_set( ‘session.use_trans_sid’, 0 ); } $cookie = session_get_cookie_params(); // create new session id $id = 0; while (strlen($id) < 32) { $id .= mt_rand(0, mt_getrandmax()); } $id = md5( uniqid($id, true)); // kill session session_destroy(); $cookie[‘lifetime’] = 7*60; // … Read more

Categories PHP

EXTJS Hide Tab Panels

This is for hide the tab Ext.getCmp(tabpanel_id).hideTabStripItem(tabitem_id); This is for show the tab again Ext.getCmp(tabpanel_id).unhideTabStripItem(tabitem_id); Thanks!

Validate space in Java Script

function trim() { ogg =document.getElementById(‘testid’).value; ogg1 = /\S+/.test(ogg); //return /\S+/.test(ogg); if(ogg1==” “){alert(‘blank’);} else{alert(ogg1);} } end script input type=”text” onblur=”trim();” id=”testid”

How i can open a tab from a grid every tab calling dynamic function for items of tab [solved]

Ext.QuickTips.init(); Ext.override(Desktop.ReportsWindow, { createProxy: {}, createWindow: function () { var desktop = this.app.getDesktop(); var win = desktop.getWindow(this.moduleId); var app = this.app; var url = this.app.connection; var moduleId = this.moduleId; var myData = [ [‘Diagnosis registry’, ‘Search patients that have a particular diagnosis or ICD9 code.’, ‘diagnosis’], [‘Medication report’, ‘Search patients that have been prescribed a … Read more

Cron Job command

command for Cron job: follow: php /home/USERNAME(like redsol)/public_html/wardrobeManagement/demo_cron.php components of Cron: 1: Path to your php or cgi script 2: minutes (Value is 00 – 59. exact minute the cron executes) 3: hour (Value is 00 – 23. hour of the day the cron executes. 0 means midnight) 4: month (Value is 01 – 12. … Read more