Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 11,881
» Latest member: soheliseo
» Forum threads: 68,217
» Forum posts: 425,733

Full Statistics

Latest Threads
Help Message: Trying to g...
Forum: General Help
7 hours ago
» Replies: 2   » Views: 53
How to SEND LINK in email...
Forum: Regional User Groups
9 hours ago
» Replies: 0   » Views: 27
Close connection
Forum: General Help
9 hours ago
» Replies: 9   » Views: 106
CodeIgniter 3.1.9 release...
Forum: News & Discussion
Today, 01:55 AM
» Replies: 43   » Views: 25,694
config/user_agents.php
Forum: General Help
Yesterday, 11:22 PM
» Replies: 3   » Views: 49
The MIT License
Forum: Lounge
Yesterday, 10:42 PM
» Replies: 2   » Views: 51
Unable to load dynamic li...
Forum: Installation & Setup
Yesterday, 01:43 PM
» Replies: 2   » Views: 65
Getting encrypted name pr...
Forum: Best Practices
Yesterday, 12:11 PM
» Replies: 9   » Views: 121
Session expiring before e...
Forum: CodeIgniter 3.x
Yesterday, 08:52 AM
» Replies: 4   » Views: 82
get prev page and next ur...
Forum: CodeIgniter 4 Feature Requests
Yesterday, 05:29 AM
» Replies: 1   » Views: 82

 
  How to SEND LINK in email in codeigniter and how to GET id selected user
Posted by: jaydevvara - 9 hours ago - Forum: Regional User Groups - No Replies

Hello guyz i have create small kind of application in codeigniter,in this application i am doing forgot password module, i have created a function of forgot passowrd and send link in email But did not get id in link so how to set id in link, i want id in link and ecrypted pass in method, I need encrypted URL pass in update password view,


Code:
<form id="resetPassword" name="resetPassword" method="POST" action="<?php echo base_url(); ?>welcome/ForgotPassword" onsubmit ='return validate()'>
               <table class="table table-bordered table-hover table-striped">                                      
                   <tbody>
                       <tr>
                           <td>Enter Email: </td>
                           <td>
                               <input type="email" name="user_email" id="email" required>
                           </td>
                       <tr>
                           <td></td>
                           <td><input type = "submit" value="submit" class="button pull-right"></td>
                       </tr>
                   </tbody>    
               </table>
           </form>
Here is my model:
Code:
public function sendpassword($data) {
   $user_email = $data['user_email'];

   $query1 = $this->db->query("SELECT * from user_registration where user_email='" . $user_email . "'");
   $row = $query1->result_array();

   if ($query1->num_rows() > 0) {

       $this->load->library('email');

       //SMTP & mail configuration
       $config = array(
           'protocol' => 'smtp',
           'mailpath' => 'C:\xampp\sendmail',
           'smtp_host' => 'ssl://smtp.googlemail.com',
           'smtp_port' => 465,
           'smtp_user' => '[email protected]',
           'smtp_pass' => 'XXXXXXX',
           'mailtype' => 'html',
           'charset' => 'utf-8'
       );
       $this->email->initialize($config);
       $this->email->set_mailtype("html");
       $this->email->set_newline("\r\n");

       //Email content

       $this->email->from('[email protected]', 'Admin');
       $this->email->to($user_email);
       $this->email->subject('Password reset request');
       $mail_message = 'Dear ' . $row[0]['full_name'] . ',' . "<br>\r\n";
       $mail_message .= 'Thanks for contacting regarding to forgot password,<br> Click On Link And Reset Password:<b><a href="http://www.ciadmin.local/welcome/update_password">Reset Password</a></b>'."\r\n";
       $mail_message .= '<br>Please Update your password.';
       $mail_message .= '<br>Thanks & Regards';
       $mail_message .= '<br>Red Feather Software';

       $this->email->message($mail_message);

       //Send email

       if ($this->email->send()) {

           echo '<script>alert("success..!")</script>';
       } else {
           echo '<script>alert("Please Try Again Later..!")</script>';

       }
   }
}

Controller:
Code:
public function update_password()
{
  $this->load->model("main_model");
    $id = $this->uri->segment(3);
    echo '<script>alert('.$id.')</script>';  
    $this->load->view('update_password');
}


  The MIT License
Posted by: ChicagoPhil - Yesterday, 06:53 PM - Forum: Lounge - Replies (2)

A simple inquiry about the License and use of the Codeigniter framework.

I thought I go right to the source for this question. What limitations exactly apply to the reuse of the framework? Could a person strip parts out and reuse the code in a new framework? Are there any limitations other than keeping the copyright notice in the code?

Can we rip it apart change it and do whatever we like and then offer it to the public?

Does it all have to stay open source?

Thank You to anyone who can clear this matter up for me.


  config/user_agents.php
Posted by: leequalls - Yesterday, 05:52 PM - Forum: General Help - Replies (3)

Hi, Is it possible for the for platforms to detect what version of Mac OS X is being used?


  Help Message: Trying to get property of non-object!!!!
Posted by: PortalNET - Yesterday, 05:46 PM - Forum: General Help - Replies (2)

Hi guys 

i  have a strange issue

i have 2 servers setup with the same codeigniter version and code, one works and the other does not.. which is more strange

but ok this is the error i am getting

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: controllers/statut.php
Line Number: 32


lets check the file code



PHP Code:
<?php
/**

 */

class Statut extends Controller {
    public function __construct() {
        parent::Controller();
        $this->load->model('tuner_model');
        $this->load->model('chaine_model');
        $this->load->model('config_model');
        $this->load->helper('url');
        $this->load->helper('exec');
        $this->load->helper('toolbox');
        $this->load->database('db');
    }

    public function index($status=''$type='') {
        $data['tuners'] = $this->tuner_model->findAll();
        
        $this
->load->view('header');
        $this->load->view('navigation');
        $this->load->view('statut/index'$data);
        $this->load->view('footer');
    }
    
    
public function info($id) {
        $transponder $this->tuner_model->find($id);
        $data['transponder'] = $transponder->name;
        $num_card $transponder->num_card;
        $http_port $this->config_model->findOneByName('port_http');
        $port $http_port->value+$num_card;
        $ip $this->config_model->findOneByName('ip_http');
        if (@fopen("http://".$ip->value.":".$port."/monitor/state.xml""r")) {
                
            $dom 
= new DomDocument;
            $dom->load('http://'.$ip->value.':'.$port.'/monitor/state.xml');                
                $data
['card_path'] = $dom->getElementsByTagName('card_path');
            $data['chaines'] = $dom->getElementsByTagName('name');
                $data['pcr_pid'] = $dom->getElementsByTagName('pcr_pid');
                $data['ratio_scrambled'] = $dom->getElementsByTagName('ratio_scrambled');
                $data['service_id'] = $dom->getElementsByTagName('service_id');        
                $data
['pmt_version'] = $dom->getElementsByTagName('pmt_version');
            $data['ip_multicast'] = $dom->getElementsByTagName('ip_multicast');
            $data['port_multicast'] = $dom->getElementsByTagName('port_multicast');
            $data['traffic'] = $dom->getElementsByTagName('traffic');
            $data['chaines'] = $dom->getElementsByTagName('name');
            $data['version'] = $dom->getElementsByTagName('global_version');
            $data['uptime'] = $dom->getElementsByTagName('global_uptime');
            $data['signal'] = $dom->getElementsByTagName('frontend_signal');
        
$data['snr'] = $dom->getElementsByTagName('frontend_snr');
                $data['frontend_name'] = $dom->getElementsByTagName('frontend_name');
                $data['unicast_client_count'] = $dom->getElementsByTagName('unicast_client_count');
                $data['remote_address'] = $dom->getElementsByTagName('remote_address');
                $data['remote_port'] = $dom->getElementsByTagName('remote_port');

                
            
        
}
        else {
            $data['err'] = true;
        }
        $this->load->view('popup');
        $this->load->view('statut/info'$data);
    }
    
    public function startAll() {
        exec('sudo /etc/init.d/iptvmiddleware start');
        redirect('statut/wait');
    }
    
    public function stopAll() {
        exec('sudo /etc/init.d/iptvmiddleware stop');
        redirect('statut/wait');
    }
    
    
public function start($id) {
        $tuner $this->tuner_model->find($id);        
        exec
('sudo /etc/init.d/iptvmiddleware start '.strtolower($tuner->name));
        redirect('statut/wait');
    }
    
    
public function stop($id) {
        $tuner $this->tuner_model->find($id);        
        exec
('sudo /etc/init.d/iptvmiddleware stop '.strtolower($tuner->name));
        redirect('statut/wait');
    }
    
    
public function wait() {
        $this->load->view('header');
        $this->load->view('navigation');
        $this->load->view('statut/wait');
        $this->load->view('footer');
    }


line 32 of the code is 


PHP Code:
    $http_port $this->config_model->findOneByName('port_http'); 

Basically it pulls the information of the IP and port  to fetch the following data from  ip:port/monitor/state.xml  file

or at least it was supposed to do it , but its not..


this is the real file on the server with problems ok so it searches for the information from the xml, and displays it on PHP info file on the WEBGUI from the middleware server but for some reason its not picking up the information necessary.

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<iptvmiddleware card="20" frontend="0">
<card_path><![CDATA[/dev/dvb/adapter20]]></card_path>
    <global_version><![CDATA[2.1.0_20180602_iptvmiddleware]]></global_version>
    <global_pid>26057</global_pid>
    <global_uptime>91723</global_uptime>
    <frontend_name><![CDATA[TurboSight TBS 6909 DVB-S/S2 ]]></frontend_name>
    <frontend_tuned>1</frontend_tuned>
    <frontend_frequency>0</frontend_frequency>
    <frontend_satnumber>0</frontend_satnumber>
    <frontend_polarization><![CDATA[H]]></frontend_polarization>
    <frontend_symbolrate>4686000</frontend_symbolrate>
    <frontend_system><![CDATA[DVB-S2]]></frontend_system>
    <frontend_status><![CDATA[SCVYL]]></frontend_status>
    <frontend_ber>0</frontend_ber>
    <frontend_signal>31488</frontend_signal>
    <frontend_snr>45592</frontend_snr>
    <frontend_ub>0</frontend_ub>
    <ts_discontinuities>0</ts_discontinuities>
    <autoconfiguration>0</autoconfiguration>
    <cam_support>0</cam_support>
    <cam_number>0</cam_number>
    <cam_menustring><![CDATA[Not retrieved]]></cam_menustring>
    <cam_initialized>0</cam_initialized>
    <scam_support>0</scam_support>
    <ring_buffer_default_size>0</ring_buffer_default_size>
    <decsa_default_delay>0</decsa_default_delay>
    <send_default_delay>0</send_default_delay>
    <channel number="1" is_up="1">
        <lcn>0</lcn>
        <name><![CDATA[Esporte interativo]]></name>
        <service_type type="0"><![CDATA[Please report : Unknown service type doc : EN 300 468 v1.13.1 table 87]]></service_type>
        <ip_multicast><![CDATA[]]></ip_multicast>
        <port_multicast>1234</port_multicast>
        <traffic>1086</traffic>
        <ratio_scrambled>0</ratio_scrambled>
        <service_id>32000</service_id>
        <pmt_pid>0</pmt_pid>
        <pmt_version>0</pmt_version>
        <pcr_pid>0</pcr_pid>
        <unicast_port>1028</unicast_port>
        <unicast_client_count>1</unicast_client_count>
        <ca_sys>
        </ca_sys>
        <pids>
            <pid number="400" language="" scrambled="0"><![CDATA[Unknown]]></pid>
            <pid number="256" language="" scrambled="0"><![CDATA[Unknown]]></pid>
            <pid number="258" language="" scrambled="0"><![CDATA[Unknown]]></pid>
            <pid number="257" language="" scrambled="0"><![CDATA[Unknown]]></pid>
        </pids>
        <clients count="1">
            <client number="0">
                <socket>17</socket>                <remote_address><![CDATA[134.144.145.46]]></remote_address>
                <remote_port>22282</remote_port>                <buffersize>0</buffersize>
                <consecutive_errors>0</consecutive_errors>
                <first_error_time>1534548566</first_error_time>
                <last_write_error>0</last_write_error>
            </client>
        </clients>
    </channel>
</iptvmiddleware>


and this is the monitor.xml file from another server running fine with the same exact status.php file

both servers running same OS version, same php version, etc.etc.etc. , just different channels being streamed.



Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<iptvmiddleware card="13" frontend="0">
<card_path><![CDATA[/dev/dvb/adapter13]]></card_path>
    <global_version><![CDATA[2.1.0_20180602_iptvmiddleware]]></global_version>
    <global_pid>28170</global_pid>
    <global_uptime>15181</global_uptime>
    <frontend_name><![CDATA[TurboSight TBS 6909 DVB-S/S2 ]]></frontend_name>
    <frontend_tuned>1</frontend_tuned>
    <frontend_frequency>0</frontend_frequency>
    <frontend_satnumber>0</frontend_satnumber>
    <frontend_polarization><![CDATA[H]]></frontend_polarization>
    <frontend_symbolrate>3214000</frontend_symbolrate>
    <frontend_system><![CDATA[DVB-S]]></frontend_system>
    <frontend_status><![CDATA[SCVYL]]></frontend_status>
    <frontend_ber>0</frontend_ber>
    <frontend_signal>29520</frontend_signal>
    <frontend_snr>43624</frontend_snr>
    <frontend_ub>0</frontend_ub>
    <ts_discontinuities>0</ts_discontinuities>
    <autoconfiguration>0</autoconfiguration>
    <cam_support>0</cam_support>
    <cam_number>0</cam_number>
    <cam_menustring><![CDATA[Not retrieved]]></cam_menustring>
    <cam_initialized>0</cam_initialized>
    <scam_support>0</scam_support>
    <ring_buffer_default_size>0</ring_buffer_default_size>
    <decsa_default_delay>0</decsa_default_delay>
    <send_default_delay>0</send_default_delay>
    <channel number="1" is_up="1">
        <lcn>0</lcn>
        <name><![CDATA[TV SENADO]]></name>
        <service_type type="0"><![CDATA[Please report : Unknown service type doc : EN 300 468 v1.13.1 table 87]]></service_type>
        <ip_multicast><![CDATA[239.106.13.0]]></ip_multicast>
        <port_multicast>4013</port_multicast>
        <traffic>465</traffic>
        <ratio_scrambled>0</ratio_scrambled>
        <service_id>1</service_id>
        <pmt_pid>0</pmt_pid>
        <pmt_version>0</pmt_version>
        <pcr_pid>0</pcr_pid>
        <unicast_port>0</unicast_port>
        <unicast_client_count>0</unicast_client_count>
        <ca_sys>
        </ca_sys>
        <pids>
            <pid number="1792" language="" scrambled="0"><![CDATA[Unknown]]></pid>
            <pid number="1110" language="" scrambled="0"><![CDATA[Unknown]]></pid>
            <pid number="1211" language="" scrambled="0"><![CDATA[Unknown]]></pid>
            <pid number="1213" language="" scrambled="0"><![CDATA[Unknown]]></pid>
            <pid number="150" language="" scrambled="0"><![CDATA[Unknown]]></pid>
        </pids>
        <clients count="0">
        </clients>
    </channel>
</iptvmiddleware>


so i am freaking lost.. not shure i am running out of ideas , the only difference is this


1st picture server not working

2nd picture server working




The only difference i have seen is that  server working fine has PHP5.6.37 version  with Xdebug v2.5.5, Copyright © 2002-2017, by Derick Rethans




and the one not working has the same PHP 5.6.37 version but without xdebug.. its the only difference i could see so far..

Any help, hints or ideas are welcome ...

Thxs



Attached Files Thumbnail(s)
       

  Close connection
Posted by: omid_student - Yesterday, 05:07 AM - Forum: General Help - Replies (9)

Hi
Is it important for close connection after query?
Example
$res = $this->db->query('')->result_array();
$this->db->close();

Also i have other question
How do i can delete cache only for special query?
at the moment we can delete all cache


  Menu and pages?
Posted by: wishmaster - Yesterday, 04:20 AM - Forum: Best Practices - Replies (2)

Hi,

i am currently develop one site and i do not know how to implement my idea: site will contain pages with something like wordpress' shotcodes and menu with url like below.

http://site.com/indastrial-machines/pump.../model-xxx

My thought is that i should create one controller e.g. Page and library e.g. Menu, but i don not know how to combine them.

Any ideas.

--
Vit


  success: function(data)
Posted by: jackey - Yesterday, 03:32 AM - Forum: General Help - No Replies

hi,
after successfully adding new employee, same time I want to add a record to increment table from using the data added to emp table.  
inside   success: function(data)how and where to add, without opening new window?
if I successfully add data to 1st table only , then only I need to add data to 2nd table, 3rd table from using the data I added 1st table.

 function add_emp()
    {        
    var form = $('#form_new_emp')[0];
    var formData = new FormData(form);
   
        show_loading();
          $.ajax({
            url : "<?php echo site_url('index.php/User/add_new_emp')?>",     
            type: "POST",
            //data: $('#form_new_emp').serialize(),
            data: formData,
            contentType: false,
            processData: false,
            dataType: "JSON",
           
            success: function(data)
            {
                 if(data.status)
                        {             
                           location.reload();
                        }
                         else
                        {
                            hide_loading();
                            for (var i = 0; i < data.inputerror.length; i++)
                            {
                                $('[name="'+data.inputerror[i]+'"]').parent().parent().addClass('has-error');
                                $('[name="'+data.inputerror[i]+'"]').next().text(data.error_string[i]);
                            }
                        }
            },
            error: function (jqXHR, textStatus, errorThrown)
            {
               
                alert('ERROR in ADDING NEW EMPLOYEE');
            }
        });    
    }


  get prev page and next url
Posted by: neuron - Yesterday, 03:14 AM - Forum: CodeIgniter 4 Feature Requests - Replies (1)

To build right structure (for SEO) for paginated web pages, as stated here https://support.google.com/webmasters/an...3744?hl=en we have 2 options:

1. implement VIEW ALL page or
2. put rel="prev" and rel="next" meta info in page

I am using second option. I extended Pagination Library to get prev_url and next_url. 

I guess it would very helpful functionality for Pagination Library if you add functions to get prev_url and next_url


  set_flashdata & session timeout
Posted by: rhodium - 08-16-2018, 10:57 PM - Forum: CodeIgniter 3.x - Replies (1)

I recently updated from CI 3.1.3 to 3.1.9 and I am now experiencing some strange issues with set_flashdata. 

All session features involving set_userdata() and userdata() work flawlessly. 


Code:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'sess_';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = APPPATH.'/ci_sessions/';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

My controller creates a success/confirmation message as flashdata, then followed to a redirect that will output the said message:


Code:
$this->session->set_flashdata('success_message', 'Success!');
redirect( base_url('account/page') );

The page located at account/page successfully displays the success message.  

What happens after this is puzzling. Any action/link I click after this leads to a session timeout. (All pages in this application are protected by session variables and require a logged in user.) The error message taken from the logs looks like this:


Code:
ERROR - 2018-08-15 12:02:39 --> Severity: Error --> Maximum execution time of 300 seconds exceeded
/home/project/public_html/system/libraries/Session/drivers/Session_files_driver.php 212

I ran some test to see if the session variables were still present and they are. (I output all userdata() right after showing the flashdata message, the Profiler also indicates that all session variables are still present.) 

Commenting out the set_flashdata resolves the issue. Anyone experiencing such issues with 3.1.9? (I had no issues with 3.1.3) Perhaps I messed up the update to 3.1.9... 

Any ideas?

UPDATE: I downgraded to 3.1.8 and it resolved the issue. FYI, when using 3.1.9, the session does not necessarily time out, but the page load following the flashdata usage leads to an EXTREMELY slow page load if the page uses sessions. ( well over 3-4 minutes and sometimes times out after 300 seconds. )


  Need your suggestions on a project's "thinking".
Posted by: HarrysR - 08-16-2018, 04:55 PM - Forum: General Help - Replies (1)

Hey guys,
I'm currently creating a CI project and i'm really stuck on how to cope with a situation i face. So i thought the best way to solve it was to ask someone who's more advanced here.

The situation is the following: 
I have 3 tables with data: Users, Contact info and  Pets.
These are all joined.

There will be non-registered and registered users. 

The non-registered users will submit a form with some data on (e.g. email, name and phone number) and i want from my side:
1) To check if email exists in table #1 named "Users",
2) If exists get the user_id of the existing user,
3) pass this user_id, together with phone in table #2 Contact_info
4) then finally, passing the user_id + newly created contact info id + all the other form data to table #3 Users.

The thing is that i also have upload file function in my controller and this kinda confused me.

Any ideas on how can i make it work?! 

Thank you very much!



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.