Welcome Guest, Not a member yet? Register   Sign In
  Multiple controllers simultaneously?
Posted by: El Forum - 09-08-2007, 05:37 AM - No Replies

[eluser]Unknown[/eluser]
Let's say I have two controlles: 'news' and 'polls'.
On the page that displays news, I also want a box with a poll.,
Or let's say I always want a 'web_links' controller displayed on the bottom of every page?

Does CI have a procedure for this? Or MVC frameworks in general?

Should I instantiate two controllers? Or is there a preferable method?

Thanks in advance Smile


  Bug in auto_typography()
Posted by: El Forum - 09-08-2007, 04:45 AM - No Replies

[eluser]Matthew Pennell[/eluser]
This was reported back in February, but there doesn't seem to be any reference to it in the Bug Tracker. I'm using 1.5.4 and still seeing the bug.

Input:

Code:
This is the page all about "getting involved".

You can apply for <a href="/jobs">a job</a>, or <a href="/volunteer">volunteer your time</a> to help.

Output of auto_typography($above_string):
Code:
<p>This is the page all about “getting involved”.</p>

<p>You can apply for</p><a href="/jobs">a job</a>, or <a href="/volunteer"></a><p><a href="/volunteer">volunteer your time</a> to help.</p>

I think it's to do with the 'greedy' way regex matches, so two links in the same block of text are getting a closing/opening P tag wrapped around them.


  Quick & dirty: Dreamhost .htaccess
Posted by: El Forum - 09-08-2007, 03:17 AM - No Replies

[eluser]PHP Four[/eluser]
Hello Guys,

I don't know whether its the right place to post this, but wanted to share this to those newbies who face problem in hosting CI in dreamhost and can't make the .htaccess work. Here goes the quick steps to follow for solving that:

1. Open system/application/config/config.php

2. Set

Code:
$config['index_page'] = "";

3. Set
Code:
$config['uri_protocol']    = "REQUEST_URI";

4. Add this .htaccess file to your server root (or in the folder where your files are located). Be sure to change the RewriteBase to match your folder location:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /rbs/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$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>

5. Thats it! Now enjoy CI in peace.

Regards,

Md Emran Hasan
Co-founder & CTO
Right Brain Solution


  "The URI you submitted has disallowed characters" question..
Posted by: El Forum - 09-08-2007, 12:03 AM - No Replies

[eluser]PoWah[/eluser]
In config.php there are default permitted chars setting:

Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';

But a char '%' is not allowed in my urls...

Whats wrong?


  Global_xss_filtering Anomaly?
Posted by: El Forum - 09-07-2007, 11:19 PM - No Replies

[eluser]Vik[/eluser]
I have a form on the site I'm developing, so I set:

$config['global_xss_filtering'] = TRUE;

...in config.php.

I then tried out my form, and at first everything went fine.

I was curious about whether global_xss_filtering filtered html out of the form entry fields, so I tried entering this into one of the form fields:

Code:
<b>some text</b>
When I clicked the submit button, I got an error message saying "call to undefined function get_instance()", in the _html_entity_decode_callback function, in the input.php file.

Do I need to do something else to enable xss filtering in a case like this?


  Passing url as parameter
Posted by: El Forum - 09-07-2007, 07:31 PM - No Replies

[eluser]voltechs[/eluser]
Hello all.

Got a problem, which hopefully isn't a tough one.

I want to pass for example "http://www.google.com/" as a parameter to one of my functions in CI, I.E;


http://mysite.here.com/controller/functi...oogle.com/

Now, obviously this wont work, so I tried encoding the url: "http://www.google.com/" => "http&#x3A;&#x2F;&#xww;w.google.com&#x2F;"

This doesn't work either. The browser I believe ultimatly unscrambles it. See, it would be fine if I could use the

http://mysite.here.com/controller/functi...e.com&#x2F;

but we all know that's not how CI works.

Any suggestions? Insights? Solutions?

Cheers,

-- Volte


  How to expire/delete/nullify the data array going into a view
Posted by: El Forum - 09-07-2007, 03:53 PM - No Replies

[eluser]LeePR[/eluser]
I have a view like this:

Code:
// Main view
$data['foo'] = "bar";
$this->load->view('thing1', $data);
$this->load->view('thing2');
$this->load->view('thing3');
In thing1, I can do
Code:
// Thing 1
echo $foo // gives "bar"
however, even though I'm no passing the data array into thing2, thing2 will still see the data e.g.
Code:
// Thing 2
echo $foo // gives "bar"
Even if I change thing1 to the following
Code:
// Thing 1
echo $foo // gives "bar"
$foo = null;
and change the main view to
Code:
// Main view
$data['foo'] = "bar";
$this->load->view('thing1', $data);
$data = null;
$this->load->view('thing2', null);
$this->load->view('thing3');
]
thing2 is still printing out bar!
Code:
// Thing 2
echo $foo // gives "bar"
Caching is off AFAIK (I haven't explicitly turned it on anywhere). Can anyone tell me how I might reset the data array?


  Multiple mysql Stored Procedures in 1 connection
Posted by: El Forum - 09-07-2007, 03:53 PM - No Replies

[eluser]Unknown[/eluser]
I have a question about using MySQL stored procedures with one controller/view using PHP5, and the mysqli driver.

Whenever I try to do 2 Procedure calls with one controller/connection I get the following error:

Error Number: 2014
Commands out of sync; you can't run this command now

They are called in this fashion:

$sql = "CALL usp_Procedure1(?)";
$parms = array($id);
$qresult=$this->db->query($sql, $parms);


Anyone know how to get around this? I think this is a mySQL 5 issue that is preventing multiple Stored Procedure calls in one connection.

Thanks,

Reg


  CI Xajax and Cookies. hm....
Posted by: El Forum - 09-07-2007, 03:11 PM - No Replies

[eluser]alpar[/eluser]
I love CI and started using it with xajax now...

The problem: Can you set cookies in an ajax call in general? or is there an xajax limitation for doing that? Because the cookies that might get sent in the ajax call don't get set... so i can't log in a user with ajax.

I never tried to do that before, so i am not sure that is a limitation of the technology or am i doing something wrong.


  (mvc theory) should a controller call *only* one view.php?
Posted by: El Forum - 09-07-2007, 03:00 PM - No Replies

[eluser]gavincali[/eluser]
I'm using my controller, called browse.php, to call only 1 view file, called browseview.php. This view file calls other view files from a folder called /includes... and sometimes the include calls and include...etc...

My question: Should my controller (browse.php) be able to choose from the 12 or so view files to call directly -OR- should it only call it's mate-view (browseview.php), and let this mate-view act as a traffic-cop to the other view includes?



thanks.


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

Username
  

Password
  





Latest Threads
Any user guid or video o...
by msnisha
5 hours ago
MVC vs MVCS vs CodeIgnite...
by massimiliano1.mancini
10 hours ago
Why PHP is still worth le...
by php_rocs
Today, 05:13 AM
Is hiring a digital marke...
by Markhenry123
Today, 02:45 AM
my controller fails to fi...
by PaulC
Today, 01:40 AM
My Library cannot see ses...
by InsiteFX
Yesterday, 08:48 PM
update the framework to t...
by captain-sensible
Yesterday, 12:14 PM
CodeIgniter Shield 1.0.0 ...
by Ayatorvi
Yesterday, 06:06 AM
Update to 4.6.1
by serialkiller
05-07-2025, 11:58 AM
Can't create new database...
by paulbalandan
05-07-2025, 08:49 AM

Forum Statistics
» Members: 144,987
» Latest member: 333betjoao
» Forum threads: 78,382
» Forum posts: 379,420

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB