Welcome Guest, Not a member yet? Register   Sign In
  Missing slash (server 404)
Posted by: El Forum - 08-21-2007, 01:51 AM - No Replies

[eluser]Unknown[/eluser]
Hi,

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|web|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
Aplication reside in http://host.com/ci directory
It works fine on my localhost, but on normal server i cannot use http://host.com/ci - i have to use (otherwise getting server 404) - http://host.com/ci/ (slash added).
I spent over 2 hours trying resolve this problem with .htaccess and reading topics here :|
Maybe someone had similar problem?

best regards
(sorry for my english)


  asynchronous db call
Posted by: El Forum - 08-21-2007, 01:11 AM - No Replies

[eluser][email protected][/eluser]
Hey guys,

I am using the db->simple_query('call procedure();');

and was wondering if this call is asynchronous?

If not, how can I make an asynchronous db call? The procedure takes a while and i don't want the web user waiting that long

???any other ideas???

thanks.


  Accessing controller variables in the viewer
Posted by: El Forum - 08-21-2007, 12:18 AM - No Replies

[eluser]dedavai[/eluser]
I'm having trouble accessing variables created inside the controller from within the viewer. For example, inside the controller (home.php) I have the following:

Code:
function view() {
...
$sub = false;
$this->load->view('home_view');
}
and inside the view file (home_view.php) I have
Code:
<input type="text" name="cp" value="<?=($sub ? "CP value" : "");?>">
However, the $sub never makes it from the controller to the viewer. Is there a special way to reference the variables ?


  Active Record
Posted by: El Forum - 08-20-2007, 10:52 PM - No Replies

[eluser]schnoodles[/eluser]
Hello i was playing around with active record, and just got stuck with a select statement of

Code:
SELECT *,count(id),(SELECT MAX(id) FROM channelpollvote WHERE channelpollid=2)  FROM channelpollvote WHERE channelpollid=2 GROUP BY vote;

And i cannot think of how i could implement this :\

Does anyone know using the way of

$this->db->select();


  best practice with form,validation,error,success,action order
Posted by: El Forum - 08-20-2007, 09:24 PM - No Replies

[eluser]sikkle[/eluser]
Hi to this community again Smile

i just want to advise, this is maybe a stupid one but let's go.

We all know, a lot of our work consist to manage the input data, show form, error, validation etc. etc.

so i'm trying to figure what is barely the best practice if i give you this example :

You get a controller, we will call it MyLovelyController.php.

indeed we get the same structure as usual, constructor, index.

imagine this controller is just to do this :

show a form to be fill out by the user, let imagine like old good example, this describe a car.

So

field :

Model (select comin from db model indeed)
Color
Motorhp


So we have to show the form, do the validation, re-show the form with current data until the validation as been accepted And after show a little success bouton to do any action, maybe continu, maybe getback now whatever.


So we get back to our controller :

what is the best practice order, i mean


if data in form, do the validation ?


if validation fail
show error
reload view ?

Else

show the blank form ?

else again

show the success form ?



I know it's not the way to go, but this is a example of what i'm looking for.

someone could be kind enough to give a good explaination of barely best practice with form,validation,error,success,action order ?

Many thanks for this again Smile


  DB sessions, performances worries...
Posted by: El Forum - 08-20-2007, 07:12 PM - No Replies

[eluser]Référencement Google[/eluser]
Hi,

Using the db_session library to store some session data at almost each page view for each users, I am worry about performances when the website will go live and will have 1000 visitors / hour.

Is it possible that the use of native PHP sessions could be better than using DB to store things like the actual page wich is viewing the visitor in real time (the reason for that is to get him back to the point he was viewing before a redirection for exemple).

What do you think ?


  How CI handles PHP native sessions ?
Posted by: El Forum - 08-20-2007, 07:06 PM - No Replies

[eluser]Référencement Google[/eluser]
Hi,

I am not sure about how do CI handles native PHP sessions ($_SESSIONS) because I get problems, it seems that my sessions are not kept between pages.

I have a library to manage sessions from DB (db_session) but I would like also to use some sessions as the classic way, having for some things the use of the DB, and for some other things the use of native sessions.

Some code maybe will help:

config.php

Code:
$config['sess_cookie_name']        = 'NipX';
$config['sess_expiration']        = 7200;
$config['sess_encrypt_cookie']    = TRUE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']        = 'ci_sessions';
$config['sess_match_ip']        = TRUE;
$config['sess_match_useragent']    = FALSE;

$config['cookie_prefix']    = "";
$config['cookie_domain']    = "";
$config['cookie_path']        = "/";

Some controller part:
Code:
if(!isset($_SESSION['category']))
        {
            $_SESSION['category'] = $this->view_category();
            echo $_SESSION['category']; // for debugging
        }

        $this->category = $_SESSION['category'];

Unfortunally at each page load, the session value is changed, in a classic PHP script, it wouldn't be...

Could somebody help ?


  Where should I put menu generation code?
Posted by: El Forum - 08-20-2007, 05:54 PM - No Replies

[eluser]tmcw[/eluser]
Okay, so working on le CMS... in my public controllers, for each page generated, I've been putting a bit of logic for fetching items from a Page_model, sorting those into a tree, and putting that on a page. I've got it to the point that I at least have that logic in a function within each controller, so I can call it like $data['menu'] = $this->menu('Page_model') and so on.

My question is whether there's a better way to do this... as a helper, plugin, etc? I've been running into the problem that helpers seem to exist outside of the CI object system, so I can't call in a model. Plugins, I think, can, but the manual tells me that they usually have only one associated function. I don't know why.

Any suggestions? It isn't a killer problem, but I figure it's fairly common and I'd like to build this thing the best way I can.

Thanks


  Strange installation problem
Posted by: El Forum - 08-20-2007, 05:03 PM - No Replies

[eluser]ryantxr[/eluser]
I use a separate LINUX server to run Apache/PHP/Mysql. I decided to install Apache+PHP on my workstation for quicker experimentation. Code Igniter displays blank pages. Here is what I know so far.

OS: Windows XP
apache 2.2.4
PHP 5.2.3

I verified that PHP is functioning.

I traced through the Code Igniter code and it gets all the way to CodeIgniter.php where it is trying to instantiate the class. From there, it seems to just go nowhere. The following shows where it got to.

Code:
print("<br>CodeIgniter.php ["."Before instantiating the controller for class $class.$method"."]");

// Instantiate the Controller
$CI = new $class();
// DOES NOT GET HERE
print("<br>CodeIgniter.php ["."After instantiating the controller for class $class.$method"."]");
Has anyone ever seen this before?


  Bah! Google index subdomain rather than the real domain!
Posted by: El Forum - 08-20-2007, 04:22 PM - No Replies

[eluser]CI Lee[/eluser]
Hello all...


I had been using pr1.domain.com to preview a site for the client. Now I use domain.com yet the google index still points to pr1.domain.com, when someone clicks that link it is valid because the subdomain (or any for that matter) points to domain.com.

Any suggestions on how to fix that? I have the webmaster tools and can do the url removal if I want however I dont want to lose those inbound links.

-Lee


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

Username
  

Password
  





Latest Threads
Changing Session cookie -...
by paulbalandan
1 hour ago
Update from 4.6.0 to 4.6....
by Vespa
8 hours ago
hot-reload side effects s...
by InsiteFX
11 hours ago
using app/Config/App.php ...
by sam547
05-16-2025, 03:04 PM
Setting baseURL in Regist...
by grimpirate
05-15-2025, 02:20 PM
CRUD Code Generator
by DeanE10
05-15-2025, 05:31 AM
CodeIgniter.com - Report ...
by Harry Lyre
05-14-2025, 04:26 AM
Missing closing bracket w...
by abf
05-13-2025, 07:27 PM
Sessions old files are de...
by InsiteFX
05-12-2025, 10:30 PM
Ajax post failing with Ty...
by PaulC
05-12-2025, 12:23 AM

Forum Statistics
» Members: 146,691
» Latest member: kinhnghiemchoif168
» Forum threads: 78,392
» Forum posts: 379,468

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB