Welcome Guest, Not a member yet? Register   Sign In
  Does CI require URL Rewriting to be enabled ?
Posted by: El Forum - 04-01-2008, 11:04 AM - Replies (9)

[eluser]hbr[/eluser]
Hi everyone,

May be this question seems a bit stupid, well I've tried to run a simple hello world app but in vain.
I get this error "Unable to determine what should be displayed. A default route has not been specified in the routing file."

While in Query String mode, (c=XXX&m=yyy), it works fine.

It is not mentioned in any page of the doc that URL Rewriting should be enabled, the only time it talks about it is in the URLs section, to explain how to remove the index.php.

Here is how I did it:
config.php => $config['base_url'] = "http://localhost:8000/boffice/";
controllers/account.php =>

Code:
<?php
class Account extends Controller {
    function index() {
        echo "hello";
    }
}    
?>

I try to access this page by typing http://localhost:8000/boffice/index.php/account

Correct ? Any idea ?


  "insert" - SQL-Problem using the Active Record Class
Posted by: El Forum - 04-01-2008, 10:51 AM - Replies (15)

[eluser]res02083[/eluser]
Hello everybody!

I have an SQL-Problem using the Active Record Class.
When I try to insert data I get the following error.
The problem is that CI wants automatically to insert into fields, that do not exist
=> INSERT INTO `user` (`_ci_ob_level`, `_ci_view_path`, `_ci_is_php5`, `_ci_is_instance`,
How canI get rid of this?

Additional Info:
Configuration of the Server with the problem: MySql5, PHP4.4
I do NOT get the error, when I try to insert the data on my notebook using the actual WAMP-Server (Configuration: MySql5, PHP5)

Any ideas?
Thank you very much,
best regards, Stephan

------------------------------------------------------------------------------------------
An Error Was Encountered
Error Number: 1054

Unknown column '_ci_ob_level' in 'field list'

INSERT INTO `user` (`_ci_ob_level`, `_ci_view_path`, `_ci_is_php5`, `_ci_is_instance`, [...]


  Query Strings
Posted by: El Forum - 04-01-2008, 10:48 AM - Replies (2)

[eluser]Spockz[/eluser]
You'll probably think. "O dear, yet another post about query strings." But I didn't find something that applies to this problem.

I'd like to make URLs that contain best of both worlds. 'Segments' and the query string. This is to accomplish the following:

Code:
http://somewhere.com/controller/function/?q=something nice&way=good

I've got this working partially. If I leave out the ? all goes well and the appropiate controller and function are loaded. However if it's left in CI generates a 404 error.

So I tried the following:
Code:
- Turning query strings on.
- Using rewrite rules to get rid of the ?
  - ([^/]*)\/\?([^/?]*)$ ./$1/$2
  - ^([^/]*)/\?(.*)$ ./$1/$2

Neither of these work, as $_SERVER['REQUEST_URI'] still contains the '?'. How would you get rid of the '?' in the URL, or what would do to prevent CI from showing the 404 instead of calling the right controller and function?

edit:
To clarify. The following works:
Code:
http://example.com/controller/function/q=a&r=b
The thing that doesn't work is when I try:
Code:
http://example.com/controller/function/?q=a&r=b

I think i'll need a Rewrite Rule that get's rid of the '?'. However, my attempts (as shown above, haven't succeeded.


  Recommender System in CI
Posted by: El Forum - 04-01-2008, 09:24 AM - Replies (5)

[eluser]pickledegg2[/eluser]
I wondered if there were any good open source recommender systems, and if anyone had attempted porting any to CI? I'm currently working on a project that will make use of one, and apart from the fact its short-circuiting my brain severely, I don't want to reinvent the wheel. In fact I'd rather re-invent a wheel, as its just a round thing that revolves, and a recommender system is a lot more complex...


  Language helper
Posted by: El Forum - 04-01-2008, 09:22 AM - Replies (3)

[eluser]Référencement Google[/eluser]
If this could make life easier of some of you, here is a language helper:

Code:
function lang($line_key = '', $args = '', $lang = '')
{
    $ci =& get_instance();

    if( ! is_array($args))
    {
        $args = array($args);
    }

    $line_key = $ci->lang->line($line_key, $lang);
    return vsprintf($line_key, $args);
}

You may put it in a helper file in your application/helpers directory.

Then you in a language file you will have something like:
Code:
$lang['test'] = "I am %s and I am %d years old";

The main advantage is that it let you pass arguments as second parameter that can be use in your language strings (like you would make with vsprintf function), here is how:

USAGE:
Code:
$this->lang->load('langagefile');
echo lang('test', array('Christophe', '35'));


  STRANGE database error
Posted by: El Forum - 04-01-2008, 09:15 AM - Replies (3)

[eluser]Justin Patel[/eluser]
Hello Friend,


I got this error

Code:
An Error Was Encountered

Error Number: 1226

User 'abcd' has exceeded the 'max_questions' resource (current value: 50000)

Select * from video where vStatus = '1' and dvds = '0' order by vTime desc



Plz tell me how can i solve it


  what is the name of the mysql administration software.
Posted by: El Forum - 04-01-2008, 08:48 AM - Replies (5)

[eluser]learnq[/eluser]
Hi,
In blog(20 min) video i saw a Mysql administration software whice is used
to create the tables. so far I have used phpmyadmin for mysql administration.
I want to know that software name Smile

Thanks.


  Trouble with image resize library.
Posted by: El Forum - 04-01-2008, 08:20 AM - Replies (2)

[eluser]JasonS[/eluser]

Code:
$config['image_library'] = 'GD';
$config['source_image'] = $upload_dir.'portfolio/'.$this->upload->file_name;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 50;
$this->load->library('image_lib', $config);
            
$this->image_lib->resize();

I am trying to create a resized image which will be called imagename_thumb.ext

When I run the above code. Nothing happens, there is no error and certainly no image is created.

Am I missing something here?


  How do you edit your URI segments?
Posted by: El Forum - 04-01-2008, 07:55 AM - No Replies

[eluser]KeyStroke[/eluser]
I have an application that utilizes URI's the usual way like this:

Code:
http://example.com/index.php/controller/function/var1/var2/var3

I'm controlling those variables through my view file, as they're basically links to categories in different places (e.g: /usa/texas/computing).

The problem is that now var1 and var2's values should be different for some links.

How do I change them in a simple, re-usable way?



Your help is much appreciated.


  Call function from another function
Posted by: El Forum - 04-01-2008, 07:33 AM - Replies (4)

[eluser]luukskywalker[/eluser]
I have a small question.

I have 2 functions in 1 controller
Say Function A and Function B

Is it possible to call function B at the end of Function A?
If so, how is this done?

I know i can call a view but i don't want a view at the end of function A


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

Username
  

Password
  





Latest Threads
Array to HTML "Table"
by paulkd
8 hours ago
TypeError when trying to ...
by b126
9 hours ago
Webhooks and WebSockets
by InsiteFX
Yesterday, 10:39 AM
Retaining search variable...
by pchriley
Yesterday, 05:46 AM
Reading a session variabl...
by xanabobana
Yesterday, 05:05 AM
Update to v4.5.1, same us...
by kenjis
04-17-2024, 07:47 PM
Codeigniter 4 extend core...
by Semsion
04-17-2024, 05:08 AM
v4.5.1 Bug Fix Released
by lokman
04-16-2024, 02:12 PM
problem with textarea
by Nitin Arora
04-16-2024, 05:07 AM
Showing pdf on browser
by aarefi
04-16-2024, 04:38 AM

Forum Statistics
» Members: 84,573
» Latest member: thermopinj
» Forum threads: 77,558
» Forum posts: 375,896

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB