title: Function to encode my php script using base64 encode method
body: <p>This is my code:</p>
  
  <pre><code>if (!defined('BASEPATH'))
      exit('No direct script access allowed');
  
  class Buy extends CI_Controller {
  
      function __construct() {
          parent::__construct();
          $this-&gt;load-&gt;library('cart');
          $this-&gt;load-&gt;model(array('product_model', 'availability_master_model', 'customer_model'));
  //        $this-&gt;load-&gt;model('common_model', 'obj_common', TRUE);
      }
  
      function index() {
          $this-&gt;load-&gt;helper(array('text', 'form'));
          $this-&gt;load-&gt;library('form_validation');
  
          $this-&gt;form_validation-&gt;set_rules('email', 'Email', 'required|xss_clean|valid_email');
          $this-&gt;form_validation-&gt;set_rules('name', 'Name', 'required|xss_clean');
          $this-&gt;form_validation-&gt;set_rules('city', 'City', 'required|xss_clean');
          $this-&gt;form_validation-&gt;set_rules('phone', 'Mobile', 'required|xss_clean|numeric|min_length[10]|max_length[10]|matches[confirm]');
          $this-&gt;form_validation-&gt;set_rules('confirm', 'Confirm Mobile', 'required|xss_clean|numeric|min_length[10]|max_length[10]');
          $this-&gt;form_validation-&gt;set_rules('land', 'Land Phone', 'xss_clean|numeric');
          $this-&gt;form_validation-&gt;set_rules('pincode', 'Pincode', 'required|xss_clean|numeric|min_length[6]|max_length[6]');
          $this-&gt;form_validation-&gt;set_rules('no_devices', 'Device Count', 'required|xss_clean');
          $this-&gt;form_validation-&gt;set_rules('address', 'Address', 'required|xss_clean');
          if ($this-&gt;form_validation-&gt;run() == FALSE) {
              $data['product'] = $this-&gt;availability_master_model-&gt;get_availability('2');
              $this-&gt;load-&gt;view('web/shop-online', $data);
          } else {
              $data = array(
                  'first_name' =&gt; $this-&gt;input-&gt;post('name'),
                  'address' =&gt; $this-&gt;input-&gt;post('address'),
                  'email' =&gt; $this-&gt;input-&gt;post('email'),
                  'city' =&gt; $this-&gt;input-&gt;post('city'),
                  'landline' =&gt; $this-&gt;input-&gt;post('land'),
                  'postal_code' =&gt; $this-&gt;input-&gt;post('pincode'),
                  'phone' =&gt; $this-&gt;input-&gt;post('phone'),
              );
              $this-&gt;db-&gt;insert('user_registration', $data);
              $user_id = $this-&gt;db-&gt;insert_id();
  
              redirect('buy/view_details/' . $user_id.'/'.$this-&gt;input-&gt;post('no_devices'));
          }
      }
  }
  </code></pre>
  
  <p>I would like to have a fully functional encryption code for the same.All the online encoder i have used is adding some extra fields of their own to the encryption code. It is just making some security issues. So please help me to solve.</p>
  
  <p>Thanks</p>