Welcome Guest, Not a member yet? Register   Sign In
include
#1

[eluser]Hamed[/eluser]
In controller I have file by the name sms.php and I want to include it in controller and it is my code:
Code:
public function ansd() {
        $qid = $this->uri->segment(3);
        $qa = $this->db->query("SELECT * FROM `qa` WHERE qid='$qid'")->row();
        
        $mob = $qa->mob;
        include_once("./sms.php");
        $username= "mehdi";//demo
     $password="mehdi";//demo
     $row=array();
     $row['fromNum']="300001222000001";
     $row['toNum']=$mob;
        WSdoSendSMS1($username,$password,$row);
     $row['msg']="سوال شما در سایت بهداشت و درمان تنکابن پاسخ داده شد";
        $sql = "UPDATE  `qa` SET  `ans` =  '1' WHERE  `qa`.`qid` ='$qid';";
        $this->db->query($sql);
        $data['url'] = base_url() . "index.php/aqa/";
        $data['msg'] = "پاسخ داده شد";
        $data['time'] = "3";
        $this->load->view('main/msg', $data);
    }
but I get this error:Severity: Warning

Message: include_once() [function.include]: Failed opening './sms.php' for inclusion (include_path='.;C:\\php\\pear')

Filename: controllers/aqa.php

Line Number: 80
How can I fix this problem?
#2

[eluser]Otemu[/eluser]
Hi,

Your probably find this post very useful http://stackoverflow.com/questions/23374...odeigniter

Hope that helps




Theme © iAndrew 2016 - Forum software by © MyBB