Welcome Guest, Not a member yet? Register   Sign In
  how to remove index.php in my URL
Posted by: El Forum - 08-29-2007, 04:53 AM - No Replies

[eluser]ppeemm[/eluser]
Hi there,

I have tried a lot of different things to solve this issue but I didn't find the good one.

here is my web site structure:

Code:
index.php
.htaccess
/site
    /config
    /controllers
    /errors
    /images
    /javascript
    /models
    /views
    /styles
/system
    /cache
    /CodeIgniter
    /database
    /helpers
    /...


I have just split off CI's files from my web site to make it easier if I have to make it evolve. (not sure it is a good way to do that?!)

in my config file, I have got this :

Code:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://www.your-site.com/
|
*/
$config['base_url']    = "http://myurl.com/";

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = "";


and in my .htaccess I have just copied and pasted this
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

from here : http://www.ellislab.com/codeigniter/user.../urls.html


I have seen in another topic that I may remove the
Code:
'/'
before
Code:
RewriteRule ^(.*)$ /index.php/$1 [L]

so I also tried with
Code:
RewriteRule ^(.*)$ index.php/$1 [L]

but my web site still doesn't work.

can you help me?

by the way, I am trying on me dev server but it was working on my computer.

thanks in advance


  [X-Post] View loading failure
Posted by: El Forum - 08-29-2007, 04:35 AM - No Replies

[eluser]ralf57[/eluser]
The original post here:
http://ellislab.com/forums/viewthread/59659/
Please test and report your results


  transactions and data integrity question
Posted by: El Forum - 08-29-2007, 03:15 AM - No Replies

[eluser]moonbeetle[/eluser]
Hi, according to the manual:

Quote:$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...');
$this->db->query('AND YET ANOTHER QUERY...');
$this->db->trans_complete();

But how do you use this if your queries must be run conditionally? Example:

Code:
if(SOME CONDITION){
$this->db->trans_start();
   $this->db->query('AN SQL QUERY...');
   $this->db->query('ANOTHER QUERY...');
   $this->db->query('AND YET ANOTHER QUERY...');
$this->db->trans_complete();
}

if(ANOTHER CONDITION)){
$this->db->trans_start();
   $this->db->query('AN SQL QUERY...');
   $this->db->query('ANOTHER QUERY...');
   $this->db->query('AND YET ANOTHER QUERY...');
$this->db->trans_complete();
}

Do the transition delimiters need to be as close to the queries as possible?
Or would this be correct as well? Example:

Code:
$this->db->trans_start();

if(SOME CONDITION){
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...');
$this->db->query('AND YET ANOTHER QUERY...');
}

if(ANOTHER CONDITION)){
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...');
$this->db->query('AND YET ANOTHER QUERY...');
}

$this->db->trans_complete();


  View loading failure
Posted by: El Forum - 08-29-2007, 02:59 AM - No Replies

[eluser]ralf57[/eluser]
I've just found a strange behaviour trying to load a view while adding dynamic data to it.
It's a peculiar case and i need it to be confirmed before i submit it to the Bug Tracker.
My controller:

Code:
class MyController extends Controller
    {
    
        function MyController()
        {
            parent::Controller();
        }
    
        function index()
        {
            $data = array(
                'title' => 'My Title',
                'path' => 'My Title',
                'heading' => 'My Heading',
                'message' => 'My Message'
            );
            
            $this->load->view('myview', $data);
        }
    
    }

If in the passed array there is a key named "path" the view is not loaded at all
throwing this warning:

Code:
A PHP Error was encountered

Severity: Warning

Message: CI_Loader::include(My Title) [function.CI-Loader-include]: failed to open stream: No such file or directory

Filename: libraries/Loader.php

Line Number: 652

a quick check reveals that $data['path'] is used in libraries/Loader.php line 652 instead of the correct path.
Removing the $data['path'] key will fix the problem.

Is this a bug? Can you reproduce it?

------------------

Environement:
PHP Version 5.2.1
Apache 2.2.3


  form_textarea() helper missing html entity encoding with form_prep()
Posted by: El Forum - 08-29-2007, 01:05 AM - No Replies

[eluser]Unknown[/eluser]
Great work on Code Igniter. It's been a pleasure getting to know it recently.

The reason I'm posting is that I noticed that html entities weren't getting encoded in my <textarea /> fields.

Here's a patch to correct that:

Code:
--- dist/system/helpers/form_helper.php
+++ fix/system/helpers/form_helper.php    2007-08-29 01:11:56.000000000 -0500
@@ -206,6 +206,8 @@
         unset($data['value']); // textareas don't use the value attribute
     }
        
+    $val = form_prep($val);
+
     return "<textarea ".parse_form_attributes($data, $defaults).$extra.">".$val."</textarea>\n";
}
Enjoy.

Just noticed a similar issue with the vals in the form_dropdown() function, by the way. Added the same form_prep($val) line to correct it.


  upload images prob
Posted by: El Forum - 08-28-2007, 09:32 PM - No Replies

[eluser]RaZoR LeGaCy[/eluser]
I am able to create the dynamic directories on the server but the images do not upload.

Unsure of what is wrong.

I would also like to be able to transfer the name of each input and then add it to each upload as the specific filename. Can it be done?

I read the user manual already and I still can't make heads or tails for some reason.

View File

Code:
<?=form_open_multipart('cp/listing/add', array('id' => 'login_form'))?>
<table>
<tr>
    <td align="right" valign="top">Image #1:</td>
    <td colspan="2">&lt;input type="file" name="1" size="20" id="1" /&gt;</td>
    <td width="100" align="right">Image #2:</td>
    <td>&lt;input type="file" name="2" size="20" id="2" /&gt;</td>
</tr>
<tr>
  <td align="right" valign="top">Image #3:</td>
  <td colspan="2">&lt;input type="file" name="3" size="20" id="3" /&gt;</td>
  <td align="right">Image #4:</td>
  <td>&lt;input type="file" name="4" size="20" id="4" /&gt;</td>
</tr>
<tr>
  <td align="right" valign="top">Image #5:</td>
  <td colspan="2">&lt;input type="file" name="5" size="20" id="5" /&gt;</td>
  <td align="right">Image #6:</td>
  <td>&lt;input type="file" name="6" size="20" id="6" /&gt;</td>
</tr>
    <tr>
    <td align="right" valign="top">&nbsp;</td>
    <td colspan="4" align="center">&lt;? echo form_submit('submit', 'Submit Images!');?&gt;</td>
  </tr>
</table>
Controller File
Code:
$config['upload_path'] = './imgs/listings/'.$this->input->post('web_id', TRUE).'';
$config['allowed_types'] = 'gif|jpg';
$config['overwrite']  = TRUE;
$config['max_size']    = '2048';
$config['max_width']  = '800';
$config['max_height']  = '600';
$config['remove_spaces']  = TRUE;
    
        $this->load->helper('file');

        $this->load->library('upload', $config);
        
        $this->load->library('email');
        $this->load->library('validation');
mkdir("/home/gainfina/public_html/pre_j/imgs/listings/".$this->input->post('web_id', TRUE)."", 0700);

$data = array('upload_data' => $this->upload->data());

echo $data;


  404 error page returns a status of 200 in the header
Posted by: El Forum - 08-28-2007, 06:55 PM - No Replies

[eluser]Danilo Stern-Sapad[/eluser]
I've checked the headers on pages that are supposed to return a 404 error and they return "HTTP/1.1 404 Not Found", which is the desired and expected behavior. However, for those familiar with Google Webmaster Tools, if I try to verify my site ownership for the Google Sitemaps application by uploading a file (e.g. google4a61g765e7b98d37.html) to the CodeIgniter root directory, Google gives me the following error:

Verification status: NOT VERIFIED
We've detected that your 404 (file not found) error page returns a status of 200 (Success) in the header.

Not sure if this is a bug or due to my own oversight or improper implementation of the show_404 function. Anyone have any ideas what's causing this? Am I using the show_404 function incorrectly? I tried sticking the path into the function but Google gave me the same error, so right now I just call it like so:

Code:
show_404();

Any help would be greatly appreciated. Thanks! Smile


  Expression Engine Template Parser
Posted by: El Forum - 08-28-2007, 05:54 PM - No Replies

[eluser]Mirage[/eluser]
Hi,

just wondering if anyone has taken a crack at enhancing the CI template parser with the powers of the EE template class.

I'm particularly liking and looking for the feature of having the content of a tag passed to it's bound function. Further I'm liking the approach of EE dynamically loading the plugins and mods when it encounters a tag. That's not so hard.

But what makes my head hurt is figuring out how to parse and properly resolve [nested] tag pairs and I'd rather be productive.

The reason I'm looking for this functionality is that it provide a very nice approach when working with cms and modularized content.

No need to chime on how to embed views within views. Been there done that 10 different ways. It's easy with CI. The major rubbing point with all codebased approaches is that I need to be able to cut the controller out of the equation and remote-control things from the view. EE is doing it perfect IMHO. As long as I can stay with MVC, the CI approach is fine. But when it comes to CMS things change and logic moves to the template. PHP as a template language is fine [for me] also, but it's much more verbose than what EE templates provide.

Can't get myself to move to EE for my projects because I only need this for parts [i.e. non-application: read 'pages'] of a given website and I'd be missing too much of CI. :-)

Hope that someone can help, otherwise I'll probably bind to SMARTY.

Thanks


  Memory usage in the profiler class
Posted by: El Forum - 08-28-2007, 03:25 PM - No Replies

[eluser]alpar[/eluser]
I would very much like to have memory usage statistics in the profiler. Any ideas?


  PostgreSQL function _list_columns
Posted by: El Forum - 08-28-2007, 02:54 PM - No Replies

[eluser]sergitin[/eluser]
i had a problem with this function
i was programing a site using mysql and everything was OK
but when i change to postgresql, scaffolding had a problem
because function <b>_list_columns</b> in mysql list all the
columns names in order to creation
<b>SELECT columns FROM TABLE</>
in postgresql
<b>SELECT column_name FROM information_schema.columns WHERE tablename='TABLE'</b>
this code return all the columns of TABLE, but first it list the number types columns
and later the strings columns, i had a table with 2 columns oh each type
i solve this adding
<b>ORDER BY ordinal_position</b>
at postgresql statement

i'd like this count in CI 1.5.5


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

Username
  

Password
  





Latest Threads
hot-reload side effects s...
by PaulC
Today, 05:09 AM
CodeIgniter.com - Report ...
by Harry Lyre
Today, 04:26 AM
Setting baseURL in Regist...
by michalsn
Today, 12:09 AM
Update from 4.6.0 to 4.6....
by FlavioSuar
Yesterday, 04:17 AM
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
intermittent smtp failure...
by InsiteFX
05-11-2025, 11:30 PM
MVC vs MVCS vs CodeIgnite...
by FlavioSuar
05-10-2025, 10:33 AM
CodeIgniter Shield 1.0.0 ...
by timesprayer
05-10-2025, 05:22 AM
Website Traffic Drop Afte...
by InsiteFX
05-10-2025, 04:23 AM

Forum Statistics
» Members: 146,002
» Latest member: georgemanilo
» Forum threads: 78,389
» Forum posts: 379,450

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB