Welcome Guest, Not a member yet? Register   Sign In
  subdirectory problem
Posted by: El Forum - 08-10-2007, 09:42 AM - No Replies

[eluser]redhorselancer[/eluser]
I have installed CI in my root directory (it worked) and then I made a folder under my root, named it "quiz" and placed a copy of the CI that i installed in my root directory but it doesn't work. I didn't forget to change the base_url to "http://www.myroot.com/quiz/" (not the real url) but does anybody know why it doesn't work and how it can be solved?

by the way, I get a CI generated 404 error when i access http://www.myroot.com/quiz/. is it a routing problem?

please help me solve this problem, thanks.


  Send out AJAX to bring back his body [solved - sort of]
Posted by: El Forum - 08-10-2007, 09:17 AM - No Replies

[eluser]obiron2[/eluser]
Hi guys,

this one has me stumped.

I have found a nice Javascript routine that will take PHP serialize() and unserialze it as a javascript object. This means I can access the PHP objects properties and values to insert into DOMobj.in nerHTML

The Unserialize() function looks at the first character of the Ajax response to see what type of serialisation it is (object, string, integer etc).

I was testing it with the following function in my controller

Code:
function nextLevel($thislevel=0)
    {
       $this->load->model('clock_model');
       $return->newlevel=$thislevel +1;
       $return->hours=0;
       $return->mins=3;
       $return->secs=40;
       while ($return->secs > 59)
       {
         $return->secs=$return->secs - 59;
       }
       $result=serialize($return);
       //$result = trim($result);
       //str

       //  The serialised string looks like this
       //  O:8:"stdClass":4:{s:8:"newlevel";i:2;s:5:"hours";i:0;s:4:"mins";i:3;s:4:"secs";i:40;}
       print $result;
    }

This is the code for the clock_model (note it is not currently being called)

Code:
class Clock_model extends Model {

    function Clock_model()
    {
        parent::Model();
        $this->load->database();
    }

    function getLevelData($LevelID=0)
    {
      $SQL = "SELECT * from CL_Blinds where Level = $LevelID Limit 1";
      $Result = $this->db->query($SQL);
      if ($Result->num_rows()==0)
      {
        return null;
      }
      $Return = $Result->row();
      return $Return;
    }

}

When I leave the
Code:
$this->load->model('clock_model');
in the controller function, the response seems to include four spaces before the text string. When I comment it out, it works fine.

Any idea why and how I stop it. As far as I can see the Model and controller are clean and not outputting any white space.

Cheers

Obiron


  CodeIgniter API (PHPDoc or similar?)
Posted by: El Forum - 08-10-2007, 07:40 AM - No Replies

[eluser]tmcw[/eluser]
Hey all, doing a bit of development with CodeIgniter and I've noticed that the official docs are friendly and very useful, but far from comprehensive and not very quick, as far as getting information. Is there a class reference other than the "Quick Reference" (which isn't all that great, doesn't show arguments, etc)?

Thanks,
Tom


  Newbie question: how to pass errormessage from comment_insert() to comments()
Posted by: El Forum - 08-10-2007, 06:25 AM - No Replies

[eluser]See64[/eluser]
I am working with the "blog example", but I can't figure out how to send a error message from the comment_insert() to the comments() part. I want to check for empty fields and tell the user he has to fill in something.

So instead of the redirect to /blog/comments, I want to go jump to comments() and pass an error message, so that I can send it along to the comment_view.


  CI is the bomb
Posted by: El Forum - 08-10-2007, 05:35 AM - No Replies

[eluser]johnwbaxter[/eluser]
I needed to export data from a db into lots of csv files based on a query that in turn is based on some values in the db itself.

40 lines of code later (i reckon i could do it in much less with some method chaining) and it is done.

Took me half an hour (25 mins of that being confused by windows file path issues mostly)

Seriously. CI is the bomb.


  problem with form_open()
Posted by: El Forum - 08-10-2007, 04:13 AM - No Replies

[eluser]freak131[/eluser]
if i use the form_open function, don't will get the right link, it just put it on the normal url, just remove the old (function, and class).

is it s bug ?

sorry for my bad english.


  Couple questions from a novice
Posted by: El Forum - 08-10-2007, 01:57 AM - No Replies

[eluser]Sulako[/eluser]
I worked only with PHP before, and now i think it's time to switch to framework.
I looked at CodeIgniter and it seems nice, but i can't figure if there is a way to do some things.

So,

1) Can i call an action of one controller from another controller? Say i have some common block in most pages of site (menu, poll, hotnews and so on), so i'd like to get data for that block from appropiate controller (hotnews from news controller) just by calling appropriate action. CakePHP has something like that - 'requestAction' function.

2) Can i implement dynamic routing? That is, i'm not satisfied with http://site/controller/action/.../ model, i want to make tree-like directory structure with any node being a controller. (http://site/dir1/dir2/action) This structure should be in DB and should be easy to modify, so just the array of routes won't do the thing.


  Extenstion of blog tutorial -> Counting the Comments
Posted by: El Forum - 08-10-2007, 01:49 AM - No Replies

[eluser]Freakish_05[/eluser]
Good morning everyone!

I've been trying to extend the blog video tutorial a bit by adding a count of the comments for a particular blog entry (i.e. "There are X comments")

I've been trying to add a count into my SQL query for all the comments where entry_id matches the blog id. This shows no sign of working :long:

Any suggestions on how I could accomplish this would be very much appreciated.

Regards,
Freakish_05


  404 error while creating new reord in scaffolding
Posted by: El Forum - 08-09-2007, 11:50 PM - No Replies

[eluser]Kaleem Ullah[/eluser]
hi...
i am facing problem while i want to create new record in scaffolding....

is there any problem in path settings?

THANKS


  Want to change Path?
Posted by: El Forum - 08-09-2007, 11:36 PM - No Replies

[eluser]Kaleem Ullah[/eluser]
hi....

I have to give the following path for my site…
hhtp://localhost/ci/testing/test/hello

but i want to change it to
http://localhost/testing/test/hello

how can i do that?

THANKS…


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

Username
  

Password
  





Latest Threads
Block IP addresses of bad...
by sevmusic
8 minutes ago
The Hidden Cost of “Innov...
by LordKaos
1 hour ago
Validation does not appea...
by grimpirate
Yesterday, 09:01 PM
Best Way to Implement Aff...
by InsiteFX
06-28-2025, 09:35 PM
Unable to scroll left nav...
by Crenel
06-28-2025, 07:58 PM
After GIT Clone: Call to ...
by paulbalandan
06-28-2025, 02:49 AM
I want to install the CI ...
by InsiteFX
06-27-2025, 03:12 AM
HTML6 and CSS5: What's ne...
by HarryKDowns
06-26-2025, 09:08 PM
Installation & Setup on W...
by mohamedtg
06-26-2025, 04:18 AM
Server Push/preloading?
by sanjay210
06-25-2025, 09:38 PM

Forum Statistics
» Members: 154,020
» Latest member: baanballuscom
» Forum threads: 78,433
» Forum posts: 379,681

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB