Welcome Guest, Not a member yet? Register   Sign In
  Session being reset on ajax call
Posted by: El Forum - 10-30-2008, 11:03 AM - Replies (9)

[eluser]gRoberts[/eluser]
Hi all,

I've just come across a weird issue (since upgrading to 1.6.3 and then to 1.7) that when ever I do an ajax call, it resets the current active session.

Has anyone ever experienced this? I'm using a vanilla setup with the default setup for sessions.

Thanks

Gav


  easy way (!) to convert result of get() into a string?
Posted by: El Forum - 10-30-2008, 10:36 AM - Replies (4)

[eluser]sparbier[/eluser]
I merely want to put the users email-address on the page, so I query the database only for the e-mail field by comparing with the id in the sessions userdata, which results in one single field in one single row.
Now that query result is in the special format of CI, i.e. apparantly I can not directly treat it just as an array (error reads something like "cannot treat CI_DB... as array") or straightforward as a string.

The code below does work, but it looks a bit stupid to me to go through a foreach if I know already that there is only one row.

any suggestions?

Code:
$i = $this->session->userdata('id');
     $this->db->select('email')->from('users')->where('id', $i);
     $me = $this->db->get();
    foreach ($me->result() as $row)
        {
                echo $row->email;
        }


  Typo in form_validation docs
Posted by: El Forum - 10-30-2008, 10:18 AM - Replies (2)

[eluser]philpalmieri[/eluser]
Hey,

$config = array(
'member/signup' = array(
array(
'field' => 'username',
'label' => 'Username',
'rules' => 'required'
),
array(


Should be
$config = array(
'member/signup' => array(
array(
'field' => 'username',
'label' => 'Username',
'rules' => 'required'
),
array(


  Database Application - Master Maintenance
Posted by: El Forum - 10-30-2008, 09:47 AM - Replies (1)

[eluser]N Narayanan[/eluser]

Hi,

I am looking for a sample application which can do the following

Master Maitenance Form - Basically to Add, Edit, Delete & Search.

Is there any application I can refer to understand how to build a database driven application using CI?

Any help on this would be highly appreciated.

Regards
Narayanan


  i have problem!
Posted by: El Forum - 10-30-2008, 08:50 AM - Replies (5)

[eluser]zeros0[/eluser]
hello.

If i dont wanna show

A PHP Error was encountered

Severity: Notice

Message: Undefined index: repassword

Filename: controllers/form.php

Line Number: 21


How can i do ?


  suggestion for best htaccess
Posted by: El Forum - 10-30-2008, 08:38 AM - Replies (18)

[eluser]hcvitto[/eluser]
hi
after i few attempt i still haven't found the right htaccess for my app.
Here's the structure of the app (codeigniter is installed the default way):

CONTROLLERS folder
main.php (file contains all the functions)
admin (directory for the admin area)
-login.php (file for the login inside admin folder)


Here's what i'm using at the moment and it works partially, means i can't access subfolder..(unless i use index.php in the url)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /app_labitta/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/main/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>

what should i add to get to:

localhost/myapp/admin/login

and not to use:

localhost/myapp/index.php/admin/login ?

Thanks vitto


  Getting values from an external include file
Posted by: El Forum - 10-30-2008, 08:12 AM - Replies (9)

[eluser]Allen Dino[/eluser]
Hi everyone!

I've been using CI for the past few weeks and it's great!

I need to get a variable from an external file (not located in the CI folder and can't be moved).

This is my app structure:
<root>/index.php
<root>/ci/<everyting CI here, didn't change default settings>

Code in my index.php (I just made this simpler):

Code:
&lt;?php
$a = "value";
?&gt;

Code in one of my controllers:
Code:
function index(){
    include ("http://<root>/index.php");
    echo $a;
}

When I run the application, I get a "Undefined variable: a" error. Why can't CI retrieve the $a variable when I "legally" included the <root>/index.php in the index of my controller. Are there any CI rules I am breaking here? Please remember that I can't move the <root>/index.php file.

Thanks for the help in advance and I hope I do make sense!


  CI 1.7 output buffer broken (for Controller->_output)
Posted by: El Forum - 10-30-2008, 07:45 AM - Replies (21)

[eluser]mycroes[/eluser]
Somehow only views are buffered, content echo-ed is not buffered. Test code:

Code:
class Test extends Controller {

  function Test() {
    parent::Controller();
  }

  function index() {
    echo 'index function';
  }
  
  function _output($output) {
    echo 'test';
  }
}

Using $this->load->view() will work, as long as you don't use echo $this->load->view($param1, $param2, true);

Of course everything can be done just by loading views, but I still have some dirty code that uses more than just views...
Regards,

Michael


  Is there an issue with the dbutil class in 1.7?
Posted by: El Forum - 10-30-2008, 07:43 AM - Replies (6)

[eluser]Joe_Archer[/eluser]

Code:
function export(){
    $result = $this->subscribers->getsubscriberlist();
    $filename = "subscribers";
    header("Content-type: application/x-msdownload");
    header("Content-Disposition: attachment; filename=$filename.xls");
    echo($this->dbutil->csv_from_result($result));
}

returns
An Error Was Encountered

You must submit a valid result object

but I know the result object is valid as I'm using the same resultset returned by getsubscriberlist(); elsewhere in the app without problems.

Code:
print_r($result);
returns:
ci_db_mysql_result Object ( [conn_id] => Resource id #35 [result_id] => Resource id #47 [result_array] => Array ( ) [result_object] => Array ( ) [current_row] => 0 [num_rows] => 2 [row_data] => )

I get the exact same results with
Code:
$this->dbutil->xml_from_result($result);
I'm using the exact same boilerplate code in a 1.6 app without any problems...


  need help on substr function on PHP
Posted by: El Forum - 10-30-2008, 07:31 AM - Replies (3)

[eluser]ebot[/eluser]
hello i will love any one to help me out on how to use the substr function on PHP, i will like to use it to limit the number of characters displayed. i don't know if anyone knows where i can get more informations on this

thanks for any help


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

Username
  

Password
  





Latest Threads
Error / Shield 1.0.3 + Ci...
by kcs
34 minutes ago
Integrating Bootstrap 5 i...
by tarcisiodev1
6 hours ago
Asset Minification Packag...
by tarcisiodev1
6 hours ago
Modify users data as an a...
by luckmoshy
7 hours ago
Is it possible to go back...
by ejimenezo
Today, 11:49 AM
SQL server connection not...
by davis.lasis
Today, 07:11 AM
Validation | trim causes ...
by Gary
Today, 05:09 AM
Problem with session hand...
by Julesb
Today, 04:13 AM
External script access to...
by PomaryLinea
Today, 03:58 AM
VIRUS reported after Chro...
by InsiteFX
Yesterday, 11:34 PM

Forum Statistics
» Members: 85,510
» Latest member: dulichdongthap
» Forum threads: 77,586
» Forum posts: 376,026

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB