codeigniter

base_url() and 403 error in CodeIgniter

試著忘記壹切 提交于 2021-02-09 08:17:05
问题 In HTML view, css link code looks like this: <link href='www.jedendzien.pl/assets/css/style.css' rel='stylesheet'> but my browser is showing adress with double domain adress www.jedendzien.pl/www.jedendzien.pl/assets/css/style.css so i'm getting 403 error. I create link by <link href='<?php echo base_url(); ?>assets/css/style.css' rel='stylesheet'> and in config.php i'm setting: $config['base_url'] = 'www.jedendzien.pl/'; In my XAMPP serwer everthing works fine but problem is appearig only on

base_url() and 403 error in CodeIgniter

牧云@^-^@ 提交于 2021-02-09 08:16:23
问题 In HTML view, css link code looks like this: <link href='www.jedendzien.pl/assets/css/style.css' rel='stylesheet'> but my browser is showing adress with double domain adress www.jedendzien.pl/www.jedendzien.pl/assets/css/style.css so i'm getting 403 error. I create link by <link href='<?php echo base_url(); ?>assets/css/style.css' rel='stylesheet'> and in config.php i'm setting: $config['base_url'] = 'www.jedendzien.pl/'; In my XAMPP serwer everthing works fine but problem is appearig only on

Jqgrid + CodeIgniter

本秂侑毒 提交于 2021-02-09 00:23:12
问题 I tried to make jqgrid work with codeigniter, but I could not do it, I only want to show the data from the table in json format... but nothing happens.. but i dont know what i am doing wrong, i cant see the table with the content i am calling. my controller class Grid extends Controller { public function f() { $this->load->model('dbgrid'); $var['grid'] = $this->dbgrid->getcontentfromtable(); foreach($var['grid'] as $row) { $responce->rows[$i]['id']=$row->id; $responce->rows[$i]['cell']=array(

Web Config file for a codeigniter application

放肆的年华 提交于 2021-02-08 12:35:19
问题 I am suffering with a web config file that is not rewrite the url for my codeigniter application. here is the web config file. <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Clean URL" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php?{R:1}"

How can i print Multidimensional Arrays in php [duplicate]

陌路散爱 提交于 2021-02-08 12:15:34
问题 This question already has answers here : php - How do I print this multidimensional array? (3 answers) Closed 6 years ago . Array ( [0] => Array ( [0] => HUBZone Small Business [1] => Small Disadvantaged Business [2] => Service-Disabled Veteran Small Businesses ) ) 回答1: $array ; foreach($array as $key => $value){ foreach($value as $k => $val){ echo $val . "<br> ; } } Output: HUBZone Small Business Small Disadvantaged Business Service-Disabled Veteran Small Businesses 回答2: print_r($array); If

How can i print Multidimensional Arrays in php [duplicate]

核能气质少年 提交于 2021-02-08 12:14:06
问题 This question already has answers here : php - How do I print this multidimensional array? (3 answers) Closed 6 years ago . Array ( [0] => Array ( [0] => HUBZone Small Business [1] => Small Disadvantaged Business [2] => Service-Disabled Veteran Small Businesses ) ) 回答1: $array ; foreach($array as $key => $value){ foreach($value as $k => $val){ echo $val . "<br> ; } } Output: HUBZone Small Business Small Disadvantaged Business Service-Disabled Veteran Small Businesses 回答2: print_r($array); If

Get value from STDClass

一笑奈何 提交于 2021-02-08 12:01:40
问题 I'm using PHP and CodeIgniter. I ran a query using the following script: $query = $this->db->query('select login_id, date_created from prjsite_login'); $row = $query->result(); print_r($row); The result of the print_r is: Array ( [0] => stdClass Object ( [login_id] => admin [date_created] => 2018-04-04 13:18:42 ) ) Which is correct. Thou when I tried to fetch 1 object or value from stdClass using the following script: echo $query->login_id; I received an error below: A PHP Error was

How can I output XML stored string from controller or view in Codeigniter

怎甘沉沦 提交于 2021-02-08 11:45:46
问题 I want to show XML content header type output from view but getting an error. Below is the code that I am putting into my view. <?php header("Content-Type: text/xml;charset=iso-8859-1"); ?> <?php '<?xml version="1.0" encoding="UTF-8" ?>' ?> <urlset xmlns=""> <url> <loc>Something</loc> <priority>1.0</priority> </url> <!-- My code is looking quite different, but the principle is similar --> <url> <loc>Somthing</loc> <priority>0.5</priority> </url> </urlset> And that is the error that I am

Inaccurate retrieval of values from an input fields using javascript referenced by inputs class names

瘦欲@ 提交于 2021-02-08 11:43:30
问题 I have created an input fields populated by ids that I will use later to make a query in my database via javascript. Using foreach loop, the fields were populated correctly by their respective ids. Using javascript I want to be able to access this ids, however, using the onclick function that is based on their class name, the values for the first and second input fields are the only fields that returns the correct id value and the rest input field values were taken from the second input field

JSON_decode problem with array posted to CodeIgniter

主宰稳场 提交于 2021-02-08 11:41:08
问题 I am certain I am making a simple mistake... but simply can't find it. Ultimately I am posting a JSON array from an Android app (that part is working), but for the time being I am simply testing between two PHP pages (1: test PHP page with basic form, and 2: the CodeIgniter final destination) Here is what I have: At the form page: <form action="bambooinvoice/index.php/api2/newinvoice/4/0/0" method="post"> <?php $array = array("items"=>array( "taxable"=>1, "quantity"=>1, "amount"=>123.99,