Welcome Guest, Not a member yet? Register   Sign In
  Help - CI Not Working on Bluehost - Deadline Looming
Posted by: El Forum - 11-30-2008, 01:34 AM - No Replies

[eluser]ladyj001[/eluser]
I am in some serious need of help with getting my CI app running on bluehost...

The problem is that I need to run PHP5+ and I need URL Rerouting. Both are configured in the .htaccess file.

Routing works fine until I add a line for PHP5 Support. Then PHP5 support works but, not
Routing. No matter what URL I enter, I only see my home page.

Can't .htaccess files handle both directives?

Any help would be greatly appreciated. I am under a deadline and quite frazzled.

Here is the line bluehost adds to the .htaccess file to make it run PHP5...
# Use PHP5 as default
AddHandler application/x-httpd-php5 .php
#
#

Here is the rest of the file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
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>


My .htaccess file reads like so per the wiki...

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
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>


  Suggestion for htaccess problems
Posted by: El Forum - 11-29-2008, 11:50 PM - No Replies

[eluser]ccb.kscott[/eluser]
I was having problems getting the htaccess file to work and remove the index.php from my url strings.

I was following several of the threads in this forum, and the contents of my file were the same, but it was like the htaccess file wasn't being read.

The default settings on my Apache server (on Mac OS X Leopard) has the AllowOverride directive set to None in the base httpd.conf file. I added AllowOverride All to the vhost definition for my CI website and everything started working.

Just a suggestion for those that are getting frustrated with htaccess problems.


  Which technique usually professional CI use for SEO?
Posted by: El Forum - 11-29-2008, 11:29 PM - Replies (15)

[eluser]webbymonk[/eluser]
I am learning mod-rewrite for beautifying URL, but there is a lot of way,,
Especially CI already provided the segmented URI for easy query.

For example:
Old fashioned URL:
http://www.site.com/index.php?cat=123

CI style
http://www.site.com/cat/123

If I want to achieve http://www.site.com/cat/Event-and-Entertainment

Which technique is the best for this SEO?

1. using Mod-Rewrite to rewrite http://www.site.com/cat/123 to http://www.site.com/cat/Event-and-Entertainment

2. Do query directly not by ID but by category name?
ex: select * from category where category_name = 'Event & Entertainment'


  Form actions
Posted by: El Forum - 11-29-2008, 10:11 PM - Replies (13)

[eluser]baalwww[/eluser]
YANQ (yet another newbie question)... I have the form action in my form as

Code:
action="admin/process_login"

What I find is that when I submit the form, the function index() in my controller gets executed. I end up back at the login form, via index() calling login() in the controller, with the uri showing being index.php/admin/login and the '***here' in the code below not appearing. This is all fixed if I have the action as
Code:
&lt;?php echo base_url();?&gt;index.php/admin/process_login
but I shouldn't have to have the full url all the time, should I?

Here is the applicable part of my controller

Code:
function index()
      {
          if(! $admin_id=$this->session->userdata('admin_id')):
                redirect('/admin/login/', 'refresh');
          endif;
      }

      
      function process_login()
      {
      echo '***here';
      }


  Active Record Pattern
Posted by: El Forum - 11-29-2008, 09:53 PM - No Replies

[eluser]Unknown[/eluser]
Hey guys !

Does anybody know a .NET's implementation of CI's Active Record feature ?


  Call to a member function result() on a non-object
Posted by: El Forum - 11-29-2008, 07:47 PM - Replies (5)

[eluser]mikka23[/eluser]
Well the title is extremely vague but thats because Im not sure what Im doing Big Grin. Anyways. I am receiving the following error:

Code:
Call to a member function result2() on a non-object on line 20.

Basically i am making a cms. These two php above are to edit pages currently in the database. So you go to a url with the id in the url and it displays a form with the current details which are in the database for that id. That was fine and working perfectly. Only problem was encountered when I added two new columns into my database: parent and sibling. I want a select field with the info from 'parent' for the page we are editing. Thats fine and working. The problem arises when I want to show every 'slug' for every row in the same table apart from the slug of the page we are editting and any rows where 'parent' does not equal "none"(default value for column). I do not know how to show this because I used a where clause in the database get command therefore I don't have the information from the database for any other rows apart from the one we are editting (id = uri section 4).

All help is greatly appreciated. I am a PHP noob so if you need me to explain anything a little please say as I realise my explanation is really vague.


I was previously trying:

in controller:
Code:
$this->db->where('id', $this->uri->segment(4));
    $data['query'] = $this->db->get('pages');
    $this->load->view('managepageview', $data);    
    
    $this->db->where('parent', 'none');
    $pdata['parental'] = $this->db->get('pages');
    $this->load->view('managepageview', $pdata);

in managepageview:
Code:
&lt;?php
foreach($query->result() as $row){
echo "<h2>Manage Page - $row->title</h2>";
echo form_open('admin/pages/managepage');

echo "<h4>Title</h4>
&lt;input type='text' id='title' name='title' value='$row-&gt;title' size='50' />

<h4>Slug</h4>
&lt;input type='text' id='slug' name='slug' value='$row-&gt;slug' size='50' />

<h4>Content</h4>
&lt;textarea id='content' name='content' cols='80' rows='15'&gt;";
echo ( htmlentities($row->content));
echo "&lt;/textarea&gt;
<h4>Parent:</h4>
<select name='parent'>
  <option value=' <$row->parent'>$row->parent</option>";
  
        foreach($parental->result() as $bow){
           echo "<option value='$bow->slug'>$bow->slug</option>";
            }
echo "</select>
&lt;input name='id' type='hidden' value=' $this-&gt;uri->segment(4); ?&gt;'>
<p>&lt;input type='submit' value='Update' /&gt;&lt;/p>
&lt;/form&gt;";
echo form_open('admin/pages/deletepage');
echo "&lt;input name='id2' type='hidden' value='";
echo $this-&gt;uri->segment(4);
echo "'><p>If you want to delete the page click the button below:</p>
    <p>&lt;input type='submit' value='Delete' /&gt;&lt;/p>
&lt;/form&gt;";
}
?&gt;

It doesn't show anything for the second set of results however, apart from this part it works perfectly:
Quote:&lt;?php foreach($parental->result() as $bow):?&gt;
<option value=" &lt;?=$bow->slug?&gt;">&lt;?=$bow->slug?&gt;</option>
&lt;?php endforeach; ?&gt;


  1.7 Form validation
Posted by: El Forum - 11-29-2008, 07:34 PM - Replies (5)

[eluser]nzmike[/eluser]
Hi there,

I've been building an application for a few months now a decided to upgrade to latest version of Code Igniter (1.7) to try out the new form validation class. I have everything working except for two things.

1. In the old validation class I would use something like:

Code:
$this->validation->content = $result->content;

To populate the inputs with data from the database and this doesn't seem to work with the new validation class (and yes I am changing it to $this->form_validation->content = $result->content).

2. To actually insert/update a value from the form to the database I called the model from the controller with something like:

Code:
$this->example_model->insert_content($this->validation->content)

Is this the correct way of doing it? And how do I do this in the new validation class? I've read the documentation but couldn't find answers to these questions...maybe I'm missing something.

Anyway Cheers,
Mike


  HAML in CodeIgniter
Posted by: El Forum - 11-29-2008, 07:00 PM - Replies (4)

[eluser]Teks[/eluser]
I was wondering if anyone has had any experience in integrating HAML templates in CodeIgniter - as you may be able to tell, I'm coming from the RoR world.

I know that there is a haml parser in php available publicly, but do not know how well it works, and if it can be integrated into CodeIgniter at all.

Does anyone have any experience with this?


  Active Record: how do I combine two or_like with an AND between them?
Posted by: El Forum - 11-29-2008, 05:52 PM - Replies (3)

[eluser]sparbier[/eluser]
Hi all,
I need to run a query that takes inputs from two arrays (from post data, don't know beforehand how many elements are given), and looks for the elements of these arrays in two separate fields in my database. So this is what I did:

Code:
if (isset($_POST['region'])) {
        foreach ($_POST['region'] as $r)  {
            // put the searched id between commas before searching for it in the string, in order not to e.g. find a 4 contained in 42 but only ,4,
            $searchstring = ','. $r .',';
            $this->db->or_like('regions', $searchstring);
        }
    }
    if (isset($_POST['instrument'])) {  
        foreach ($_POST['instrument'] as $i)  {
            $searchstring = ','. $i .',';
            $this->db->or_like('instruments', $searchstring);
        }
    }
The issue now is, that while I do want the LIKE statements within each of the two criteria be linked with OR, the two criteria must be linked with AND.

Is there any way to achieve this with Active Records?


  Load Flex 3 Application from CodeIgniter Web Server
Posted by: El Forum - 11-29-2008, 05:05 PM - Replies (7)

[eluser]fisad[/eluser]
Hey.

Anybody know how load a Flex 3 Application how home page in Web Server (Hosting) with CodeIgniter active


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

Username
  

Password
  





Latest Threads
Display a custom error if...
by b126
3 hours ago
Type error in SYSTEMPATH\...
by DXArc
3 hours ago
v4.5.1 Bug Fix Released
by LP_bnss
4 hours ago
Retaining search variable...
by Bosborne
6 hours ago
Getting supportedLocales ...
by InsiteFX
9 hours ago
composer didn't update to...
by Sarog
Yesterday, 03:56 PM
Pipe on url modified in %
by kenjis
Yesterday, 02:52 PM
Best way to create micros...
by kenjis
Yesterday, 02:50 PM
How to use Codeigniter wi...
by kenjis
Yesterday, 02:39 PM
extend url_to helper
by kenjis
Yesterday, 02:33 PM

Forum Statistics
» Members: 85,061
» Latest member: shbet88one
» Forum threads: 77,571
» Forum posts: 375,951

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB