Welcome Guest, Not a member yet? Register   Sign In
  .htaccess - Filenames in URI
Posted by: El Forum - 10-05-2008, 04:48 PM - Replies (4)

[eluser]Lockzi[/eluser]
Yea, you've guessed it!
This is another .htaccess help thread I'm afraid.

This is what my current .htaccess looks like

Code:
<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    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>

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript application/javascript text/css

and it works just fine for me, except for with my filemanager.
When I try to do this
Code:
http://127.0.0.1/file_management/remove/images/Kass.jpg
it rewrites the url for codeigniter ( $this->uri->uri_string() ) to
Code:
http://127.0.0.1/file_management/remove/images/Kass_jpg


Been googling, but all I can find is how to REMOVE the dot instead of BRING BACK which is what people normally want.

Cheers,
Lockzi


  default_controller gives 404
Posted by: El Forum - 10-05-2008, 03:49 PM - Replies (3)

[eluser]Sixer[/eluser]
Hi, my routes.php looks like this:

Code:
$route = array(
                 "default_controller"  => "c_Home", // 404
                 "scaffolding_trigger" => "",
                 "home"       => "c_Home",  // works
                 "tag/:any"  => "c_Tag/view",
                 "tags"        => "c_Tag/all"
                 );

As stated in the comments, my default_controller, that is visiting the site's domain, gives a CI generated 404. Visiting /home/ however takes me to the right page.

I've tried changing the URI protocol to the various options but no cigar.

I'm running CodeIgniter 1.6.3 on PHP5 and Apache 2.0.55 on Ubuntu 6.06.

Any ideas?


  Individual html/php files and CI side by side
Posted by: El Forum - 10-05-2008, 03:15 PM - Replies (5)

[eluser]felyx[/eluser]
What I mean by that is when I have to palce one or more individual html or php files to the root directory where I have my index.php and display them as a standalone page (not with CI). With CodeIginiter just by copying them there they won't display. For example, On my website I have a home page. I can access it by the address http://mysite.com/home. If I place an individual html file like standalone.html I cannot access it by the address http://mysite.com/standalone.html because it is not a controller and I dont want it to be one. I could allow it in htaccess to be accessible but if I have like 30 of them it is a problem. I do not want to put them in a directory and allow them in htaccess either. Unfornutaly sometimes a customer wants that so if anyone could possibly help me with an easy solution I would thank that.


  Doctrine and CI classname collitions
Posted by: El Forum - 10-05-2008, 02:03 PM - No Replies

[eluser]Unknown[/eluser]
Hi!

I have followed the "how to add Doctrine to CI" "guide" on the Doctrine site, which is nothing really special, but I think I have a problem: Doctrine generated models are named without postfixes or prefixes (so I will have a User.php User class, not UserModel or User_model etc.) just like CI Controllers.

So the question is, is it possible to painlessly postfix Controller names? (No, renaming Doctrine generated classes did not cut) Like class User_controller extends Controller... ? Or any other general solution? I don't really want to modify CI core and/or create custom routes whenever I have a collision (though I might end up with that) Sad


  Creating dynamic functions based on values from database
Posted by: El Forum - 10-05-2008, 12:42 PM - Replies (6)

[eluser]Unknown[/eluser]
Hi

I was wondering is it possible to generate dynamic functions within controller named after values obtained from URL (which is originally from a database)?

For example:

Code:
http://www.something.com/index.php/value1/value2/

obviously the 'value1' segment is a function on its own and I was wondering if it is possible to generate the 'value2' dynamically at all?

Many thanks. Smile


  Security in Codeigniter
Posted by: El Forum - 10-05-2008, 11:49 AM - Replies (9)

[eluser]Cozmika[/eluser]
Hello,

I'm learning PHP. I know a little and I decided to start with Codeigniter.
What are the best practices in security with Codeigniter when using forms/strings/some input etc.?


  Validation - Can someone explain this code?
Posted by: El Forum - 10-05-2008, 07:27 AM - Replies (5)

[eluser]The Wizard[/eluser]
Hello friends,

ive modified my code a little according to the validation tutorial series (7 screencasts) and now i have a question about a particular part in the code.

Code:
function setinfo ()
    {

//..

        $this->load->helper( 'form' );
        $this->load->helper( 'url' );
        $this->load->helper( 'language' );
        
        $form = array
        (
        
            'fields' => array
            (
            
                'name'                 => 'Name',
                'gender'             => 'Gender',
                'country_code'        => 'Country',
                'work'                 => 'Work',
                'birthday'             => 'Birthday',
                'city_living'         => 'City Living',
                'city_hometown'     => 'City Hometown'
            
            ),
            
            'rules' => array
            (
            
                'name'        => 'required',
                'gender'    => 'required',
                'country'    => 'required'
            
            )
        
        );

            $this->load->library('validation');
    
            $this->validation->set_rules( $form['rules'] );
            $this->validation->set_fields( $form['fields'] );
            
            
            if ($this->validation->run() == FALSE)
            {
                $data['theme_path']     = $this->theme_path;
                $data['theme_folder']    = $this->theme_folder;
                
                if ( $_SERVER["REQUEST_METHOD"] == 'POST' )
                {
                    $data['values'] = $_POST;
                    
                }
                else
                {
                    $user_info = $this->Model_user->User_GetUserInfo( $this->Model_user->Session_UserID() );
                    $data['values'] = $user_info;
                }
                
                $this->load->view( $this->theme_folder . 'master-info_edit.php', $data );            
            }
            else
            {
    

                $data['info-name']                = $this->input->post ('name');
                $data['info-city_living']        = $this->input->post ('city_living');
                $data['info-city_hometown']        = $this->input->post ('city_hometown');
                $data['country_code']            = $this->input->post ('country');
                $data['info-work']                = $this->input->post ('work');
                $data['info-birthday']            = $this->input->post ('birthday');
                $data['info-gender']            = $this->input->post ('gender');
    
                $user_id = $this->Model_user->Session_UserID();
                
                $info_result = $this->Model_user->User_SetUserInfo( $user_id, $data );
                
                redirect ( 'user/settings/success' );
            }                              
        

    }

and for the view part, when setting or better say, re populating forms,
we tend to use things like:
Code:
&lt;?= form_input( 'name', $this->validation->name ) ?&gt;

in this modified code i use:
Code:
&lt;?= form_input( 'name', $values['name'] ) ?&gt;

but as you may have noticed, i didnt use the first one in a fashion like
$this->validation->name to re-populate it.

So how come, this code actually works?

I would be more then happy if i can understand how this works.

Thanks in advance


  Encrypt and URL disallowed characters - alphanumeric option?
Posted by: El Forum - 10-05-2008, 07:23 AM - Replies (4)

[eluser]antonumia[/eluser]
I am constructing an autologin process whereby restricted users on a site receive an email with a url containing controller/function/encrypted_name/encrypted_password.


I want to avoid allowing more characters in $config['permitted_uri_chars']

Is there a way to restrict the encryption to alphanumeric characters only?

thanks,

anton


  Problem with css style in view
Posted by: El Forum - 10-05-2008, 04:30 AM - Replies (1)

[eluser]Unknown[/eluser]
Hello,

I have one little problem, what I can't resolve... I found few solutions, but on my CI not works.

I try to include css style like that (url helper is enabled):

Code:
&lt;link href="'.base_url().'system/application/views/template/style.css" rel="stylesheet" type="text/css" /&gt;

But style is not loaded Sad I try go to http://localhost/system/application/view.../style.css but I see:

Code:
404 Page Not Found
The page you requested was not found.

Please, help


  Loading assets (js, css, ...)
Posted by: El Forum - 10-05-2008, 03:04 AM - Replies (15)

[eluser]Dauntless[/eluser]
Hi,

Problem in specific: I'm using Lightbox which is loading "image/close.gif", but since this is a relative path, it is forwarded to "myController/image/close.gif"

I've had this problem before and I solved it by creating a new view, copy pasting the CSS file in to the view and using the helper functions to create absolute paths everywhere.

Since this approach requires a lot of work (especially for the Lightbox integration), I'm sure there must be a much easier way to do this. My assets are located in folders on the root of the domain.

Thanks for your time Smile


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

Username
  

Password
  





Latest Threads
The pipe operator in PHP ...
by InsiteFX
5 hours ago
Heads up for users using ...
by FlavioSuar
9 hours ago
Best Way to Implement Aff...
by InsiteFX
Today, 02:58 AM
Table (view class) Row ID
by grimpirate
Yesterday, 11:22 PM
curl + response body
by michalsn
Yesterday, 10:10 PM
Happy 4th Everyone
by InsiteFX
Yesterday, 09:31 PM
AbuseIPDB Module
by InsiteFX
Yesterday, 09:27 PM
tool bar not showing
by Luiz Marin
Yesterday, 04:46 AM
Tool bar not showing
by Luiz Marin
Yesterday, 04:28 AM
The Hidden Cost of “Innov...
by fcoder
07-02-2025, 03:11 AM

Forum Statistics
» Members: 154,775
» Latest member: babu88procom
» Forum threads: 78,440
» Forum posts: 379,728

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB