Category: PHP

Hiring PHP Programmers with 2+ yrs Exp.

Greenfos technologies,Kochi Hiring PHP Programmers with 2+ yrs Exp. Eligibility: 1. Candidates should have min 2 yrs experience 2. Excellent knowledge of PHP and well known how to work on OOP concepts. 3. Knoweldge in Yii Framework is Preferable but not necessary. Immediate Joining…. Salary: Will depend on the Interview and experience Location: KOCHI send

Export Database using codeigniter

Database Utility Class : CodeIgniter PHP script to download mysql db-codeigniter,Backup MySQL database with CodeIgniter public function dbexport() { $this->load->dbutil(); $prefs = array( ‘format’ => ‘zip’, ‘filename’ => ‘my_db_backup.sql’ ); $backup =& $this->dbutil->backup($prefs); $db_name = ‘backup-on-‘. date(“Y-m-d-H-i-s”) .’.zip’; $save = ‘public/uploads/’.$db_name; $this->load->helper(‘file’); write_file($save, $backup); $this->load->helper(‘download’); force_download($db_name, $backup); }

How to print Codeigniter upload error

if you want to display errors on upload functionality in codeigniter. Use the following function if($this->upload->do_upload(‘image’)) { $contentimagedata=$this->upload->data(); $descdata[‘image’]=$contentimagedata[‘file_name’]; }else { $error = array(‘error’ => $this->upload->display_errors()); print_r($error); }

Download failed.: SSL certificate problem, verify that the CA cert is OK

Follow the simple steps to recover from the above wordpress upgrade error step 1 .Create a folder, which may be missing: /wp-content/mu-plugins step 2. Create a php file inside that folder and name upgrade_fix.php put the following code into the php file and save add_filter(‘https_ssl_verify’, ‘__return_false’); add_filter(‘https_local_ssl_verify’, ‘__return_false’); step3. Go directly and run the network upgrade again,

check ssl port in shared hosting is closed

Check ssl port in shared hosting is closed, use the php code to check if it is open. Here use gmail smtp for checking. $fp = fsockopen(“”, 80, $errno, &$errstr, 10); // work fine if (!$fp) echo “ – $errstr ($errno)n”; else echo “ – okn”; $fp = fsockopen(“”, 465, $errno, $errstr, 10); // NOT

Generate three letter month name from a date with example code

Php date function have number of usages in Web programming. You can make it our own different ways for desired output. Here the piece of php code tell how to Generate three letter month name from a date echo date(‘M’, strtotime(’14-12-1985′)); OutPut Dec 3 letter abbreviation of english Month December Searches related to php date

Enabling Maintenance Mode in OpenCart

Enabling Maintenance Mode in OpenCart

Opencart is a Lightweight E-commerce CMS with large number of modules and extensions. Easy steps for Enabling Maintenance Mode Sign in Opencart Admin Step-1: Go to System -> Settings Step-2: Select your store from the list and click on edit.           Step-3: Select the Server tab and Go to the Maintenance

Looking for PHP Expert with 3-4+ years of experience

[highlight]Looking for PHP Programmer with 3-4+  years of experience to join our team![/highlight] [highlight]Company: Bridge India ,Palarivattom[/highlight] Job Location:Cochin Requirements: Experience in any PHP frameworks. CakePHP  is Preferred Strong knowledge of PHP, OOPS, MySQL, Javascript, Jquery, HTML5, CSS. Experience in GIT. Must have excellent communication skills, logical skills and problem-solving skills. Salary: Negotiable Interested applicants

website development

Get youtube video time duration

Use the following PHP function will return the YouTube video duration.Before that following the step given below Steps for get Get youtube video time duration. 1.Create one Google API and get API key from At the time of creating api please leave the option blank “creating api Accept requests from these HTTP referrers (web

website development

CodeIgniter Disallowed Key Characters

Somewhere in the html form you simply missed the opening quote  of input name attribute(s). Example <input type=”text” name=last_name“> Just find and use the right syntax for happy coding. You can find the code for tracking disallowed characters are in system/core/input.php file function _clean_input_keys($string) { if (! preg_match(“/^[a-z0-9:_/-]+$/i”, $string)) { exit(‘Disallowed Key Characters.+’. $string)); } return

Global Ajax Event Handlers

These following Global Ajax Events to be called at the time of initialization ,completion,success,send..etc. These type of events are triggered on each Ajax request, if the global property in jQuery.ajaxSetup() is true . ajaxComplete():This global event to be triggered when Ajax requests complete. .ajaxError(): This global event to be triggered when Ajax requests complete with

Advanced method to check the mime type of file in php

Usually code is if ($_FILES[‘input_field_name’][‘type’] == ‘image/jpeg’) { //some code } but it is not fully validating the file types(mime). The following code will output the correct file type and avoids the security vulnerabilities of php. $phpfileInfo = new finfo(FILEINFO_MIME_TYPE); $PhpfileContents = file_get_contents($_FILES[‘name_of_input_field’][‘tmp_name’]); $MimeFileType = $phpfileInfo->buffer(PhpfileContents);

How to Check Expired Sessions using jQuery Ajax and PHP

We can achieve using the php and ajax.The following ajax call execute in every 10 seconds to check the status of session.If it expired the user redirected to seesionout page. Ajax call in every 10 seconds   var check_current_session; function CheckForCurrentSession() { var strSession=”check_current_session=true”; jQuery.ajax({ type: “GET”, url: “check_current_session.php”, data: strSession, cache: false, success: function(result){

Major security issues facing by the websites

  Vulnerabilities Severity 1) Cross Site Scripting HIGH 2) File Upload Vulnerability HIGH 3) Directory Listing Vulnerability HIGH 4) Unencrypted Login Pages HIGH 5) Session Hijacking HIGH 6) Cross Site Request Forgery(csrf) HIGH 7) Weak Captcha Implementation MEDIUM 8) Cross Frame Scripting(css) MEDIUM 9)Internal Error Handling MEDIUM 10)Cookies are not marked as HTTPOnly LOW Recommendations

Add multiple products to Paypal Cart with One Click

Paypal is a payment gateway used in number of websites in world wide.We can post shopping cart info  to paypal from the website The following code shows the syntax of code used to post multiple cart items to paypal <form id=”paypalform” action=”” method=”post” name=”paypal_auto_form”> <input name=”rm” type=”hidden” value=”2″ /> <input name=”cmd” type=”hidden” value=”_cart” /> <input

Find Country Name By IP Address using PHP

Use the following Code to get geo location details based on Your IP $country data=getLocationInfoByIp(); echo $country data[‘country’]; echo $country data[‘city’]; function getLocationInfoByIp() { $current_ip = @$_SERVER[‘HTTP_CLIENT_IP’]; $forwardip = @$_SERVER[‘HTTP_X_FORWARDED_FOR’]; $remoteip = @$_SERVER[‘REMOTE_ADDR’]; $geo_data = array(‘country’=>”, ‘city’=>”); if(filter_var($current_ip, FILTER_VALIDATE_IP)) { $ipaddress = $current_ip; } elseif(filter_var($forwardip, FILTER_VALIDATE_IP)) { $ipaddress = $forwardip; } else { $ipaddress = $remoteip; }

Restrict ckeditor to basic toolbar

We can use javascript or jquery to apply ckeditor configuration HTML <textarea id=”textarea” cols=”15″ name=”txtdesc” rows=”5″></textarea> Javascript Must be included ckeditor.js Take the instance of ckeditor and replace with new configuration <script type=”text/javascript”> var editor = CKEDITOR.instances[‘txtdesc‘]; if (editor) { editor.destroy(true); } var editorContent =CKEDITOR.replace(‘txtdesc‘, { toolbar: [ { name: ‘document’, items: [ ‘Source’, ‘-‘,

Check whether url contains http or https using php

Sometimes the programmer need to identify the link contains http or https. Using php code can do this easily. First store the string to a php varible- $URLstring=””; Second use the substr() function to find the occurrence of http or https -substr($URLstring, 0, 7) <?php $fromUrl =’0′; $URLstring=””; if(substr($URLstring, 0, 7) == “http://”) { $fromUrl = “http”;

website development

Where is Seller ID in 2checkout?

Login to 2checkout account using your login details 1. On the top right corner of the website header menu  can see a profile picture,please click on it 2. A dropdown menu will appear with following details. Account name Account ID Username That account ID is the seller id or sid.

Check database exists in codeigniter

Load the Database Utility Class Notice: Databse Connection should be already established before loading the above class. <?php $this->load->dbutil(); ?> loaded class can access the functions using the  following method: <?php $this->dbutil->some_function() ?> <?php $this->dbutil->list_databases(); ?> the above function will  show an array of database names: <?php $dbs_smarttips = $this->dbutil->list_databases(); ?> <?php foreach ($dbs_smarttips as $db_name)

Advertisment ad adsense adlogger