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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,941
» Latest member: leequalls
» Forum threads: 66,940
» Forum posts: 419,365

Full Statistics

Latest Threads
testing with phpunit in p...
Forum: CodeIgniter 4 Support
3 hours ago
» Replies: 2   » Views: 121
How run a script on host ...
Forum: General Help
3 hours ago
» Replies: 2   » Views: 43
This page isn’t working u...
Forum: General Help
5 hours ago
» Replies: 3   » Views: 123
3.6 404 error
Forum: Installation & Setup
9 hours ago
» Replies: 0   » Views: 46
language subdomains
Forum: Best Practices
10 hours ago
» Replies: 7   » Views: 415
Which browser do you guys...
Forum: Lounge
Today, 12:09 AM
» Replies: 20   » Views: 3,954
Error 404 with unicode ch...
Forum: General Help
Yesterday, 11:02 PM
» Replies: 2   » Views: 135
Routes and hashed URLs
Forum: General Help
Yesterday, 05:02 PM
» Replies: 7   » Views: 282
CodeIgniter - French Comm...
Forum: Regional User Groups
Yesterday, 11:45 AM
» Replies: 14   » Views: 6,674
CodeIgniter 3.1.6 Release...
Forum: News & Discussion
Yesterday, 11:42 AM
» Replies: 38   » Views: 20,192

 
  (off topic) I can't access my site from home but can from work
Posted by: El Forum - 07-31-2007, 04:30 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]obiron2[/eluser]
Hi guys,

sorry for being off topic but my site is written with CI and you lot are always really helpful.

I can access my site from work but not from home.

Any attempt to access my site, or any other site on the same IP address or the server directly also times out

here is the tracert from home

Code:
Tracing route to www.frothpoker.co.uk [213.171.218.185]
over a maximum of 30 hops:

  1     3 ms     1 ms     1 ms  voyager.home [192.168.1.1]
  2    13 ms    13 ms    12 ms  lo99.bhm-0-dsl.as9105.net [212.74.111.242]
  3    14 ms    14 ms    13 ms  ge2-2-25.ho-bham0.as9105.net [212.74.106.194]
  4    15 ms    14 ms    14 ms  pos0-0.glo1.as9105.net [212.74.108.202]
  5    15 ms    16 ms    18 ms  pos2-0.glo0.as9105.net [212.74.108.166]
  6    16 ms    15 ms    15 ms  pos0-0.bri1.as9105.net [212.74.108.162]
  7    19 ms    19 ms    20 ms  ge0-0-0.he-lon0.as9105.net [212.74.109.14]
  8    20 ms    19 ms    20 ms  ge4-0-0.he-lon1.as9105.net [212.74.106.54]
  9    21 ms    19 ms    19 ms  ge-5-1-0.lon22.ip.tiscali.net [213.200.77.177]
10    19 ms    19 ms    20 ms  so-7-0-0.lon11.ip.tiscali.net [89.149.186.30]
11    20 ms    20 ms    20 ms  telewest-gw.ip.tiscali.net [213.200.78.38]
12     *        *        *     Request timed out.
13    27 ms    27 ms    29 ms  azt-tele1-pos.telewest.net [194.117.136.1]
14    27 ms    27 ms    26 ms  195.188.230.17
15    25 ms    27 ms    25 ms  195.188.230.50
16    26 ms    26 ms    26 ms  82.33.208.65
17    25 ms    27 ms    25 ms  213.171.217.2
18    26 ms    26 ms    27 ms  server213-171-218-185.livedns.org.uk [213.171.218.185]
If I connect via vpn to one of my clients from home I can connect using their DNS and gateway


Code:
Tracing route to www.frothpoker.co.uk [213.171.218.185]
over a maximum of 30 hops:

  1    45 ms    41 ms    40 ms  10.0.0.16
  2    43 ms    41 ms    41 ms  voyager.home [192.168.1.1]
  3    53 ms    58 ms    55 ms  gay-dsl1.wh.zen.net.uk [62.3.83.20]
  4    56 ms    61 ms    58 ms  bolzano-ae-0-232.wh.zen.net.uk [62.3.80.233]
  5    65 ms    59 ms    58 ms  193.189.130.26
  6   100 ms   102 ms    98 ms  194.117.136.217
  7   100 ms    99 ms   105 ms  194.117.136.181
  8   102 ms   122 ms    99 ms  195.188.230.5
  9    96 ms    98 ms    97 ms  195.188.230.50
10    95 ms    96 ms   102 ms  82.33.208.65
11   107 ms   105 ms   100 ms  213.171.217.2
12    99 ms    92 ms    93 ms  server213 [213.171.218.185]

Trace complete.
so I am sure the problem is with Tiscali (AGAIN!!) Can anyone exlpain what the problem is becuase I hold out very little hope from Tiscali's technical support.


  2 questions: error404 handling and regular expressions in db..
Posted by: El Forum - 07-31-2007, 03:29 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]Ji31[/eluser]
Hi,

I have two questions, so I put them here together:

1.) If I have a path like this: http://mysite.com/id/20
And if I enter some nonexistent id (for example http://mysite.com/id/160) I get a php error. What can I do to get the error404 page?

2.) I have in the db the column named keywords where I have saved keywords separated by space. And if I want to show all articles with this keyword, how do I pass the regular expression to $this->load->where('');? Or how do I should select them?


Thanks a lot


  Various processing modes
Posted by: El Forum - 07-31-2007, 02:07 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]omed habib[/eluser]
Are there any settings to change once a site is completed and placed live? possibly a production mode versus a development mode that parses files faster, etc.? I couldn't find anything in the documentation that suggested either possibility....

thanks!


  Model query with two possible inputs
Posted by: El Forum - 07-31-2007, 01:50 PM - Forum: Archived Development & Programming - Replies (3)

[eluser]kirkaracha[/eluser]
I have a list of countries I can access publicly or via a password-protected admin backend. I want to access the countries by URL name from the front end for SEO/usability reasons, and I want to access them by ID on the backend (in case I need to edit the URL name). Here's the query from my model:

Code:
function get_country_info($country_id = null,$country_url_name = null) {
    $this->db->select('
        country_id,
        country_name,
        country_url_name
    ');
    $this->db->from('countries');
    if($country_id != null){
        $this->db->where('country_id',$country_id);
        $this->db->limit('1');
    }
    if($country_url_name != null){
        $this->db->where('country_url_name',$country_url_name);
        $this->db->limit('1');
    }
    return $this->db->get();
} // get_country_info
This works fine if I use ID, but doesn't return any records when I use the URL name. Is there something wrong with my model? How should I do this?

Thanks.


  Profiler bug line 168 - 169
Posted by: El Forum - 07-31-2007, 12:58 PM - Forum: Archived Development & Programming - Replies (8)

[eluser]Jamongkad[/eluser]
As I have posted on the freakauth 1.1 thread

Quote:@DanFreak

Since we're in the process of fine tuning Fal I would like to introduce another niggle hehe. Once I got the myaccount/edit controler/method working. CI seems to spout out a strange but interesting error.

Code:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\myswebsite\system\libraries\Profiler.php on line 169

Upon inspection of this of Profiler.php line 169
Code:
line 168://$output .= "<tr><td width='50%' style='color:#000;background-color:#ddd;'>$_POST[".$key."]&nbsp;&nbsp;</td><td width='50%' style='color:#009900;font-weight:normal;background-color:#ddd;'>".htmlspecialchars(stripslashes($val))."</td></tr>\n";

line 169:$output .= "<tr><td width='50%' style='color:#000;background-color:#ddd;'>$_POST[".$key."]  </td><td width='50%' style='color:#009900;font-weight:normal;background-color:#ddd;'>";

It seems line 168 was commented out to make room for line 169. So as an experiment decided to comment out line 169 as well and lo and behold it worked! but there was this weird benchmark result that comes out of the bottom of the edit form..

please click on link below(sorry I don't know how does this forum display images).
[Image: error.jpg]
A pic of the error in this link:
[Image: error.jpg]

My tools:
Code Igniter 1.5.3
FreakAuth_light_1.1

I will attempt to fix this on my own :-) but help from Rick and the gang would be nice.


  troubles with cookies
Posted by: El Forum - 07-31-2007, 12:56 PM - Forum: Archived General Discussion - Replies (8)

[eluser]andycorpes[/eluser]
Hi Group

I'm new to CI, and relatively new to PHP, however, using raw php i CAN get cookies to work.

Using CI, i can set cookies, but cannot seem to retrieve them afterwards. Are there any "gotchas" using the CI cookie helper? or am i just being dumb after a long day? I've tried various "lifetimes", from -1 to delete the rubbish i created, through to 315360000 (10 years?)

Originally, i coded this using the session class, which all worked, however, i needed one set of session variables to live for 24 hours, and the other set to live forever (Hence 10 years). I encountered problems with the session class where ALL session variables got the same lifetime, i.e i wrote the 24 hour session variables, and it changed the life time of my 10 year session variables.

If anyone understands what i am trying to do, and knows of an alternative approach, i'd be happy to try it.

Hopefully, fresh eyes will solve my problems tomorrow.

Andy Corpes


  form GET
Posted by: El Forum - 07-31-2007, 11:32 AM - Forum: Archived General Discussion - Replies (1)

[eluser]AndyBrandy[/eluser]
Hi,

how can i easily make search form like http://www.google.com?

Because i have problem when data were send, than page http://example.com/search?q=ci
is not found... Only with &lt;form method=POST&gt; ?


  Can be method used as id?
Posted by: El Forum - 07-31-2007, 11:05 AM - Forum: Archived General Discussion - Replies (6)

[eluser]AndyBrandy[/eluser]
Hi,

Can i use method as id or parameter?
I need From this url : example.com/text/programing/1/

go to the class "text" and here goes to index.

It's real?


  Comments on my first CI application (Calendar/event)
Posted by: El Forum - 07-31-2007, 11:00 AM - Forum: Archived Development & Programming - Replies (2)

[eluser]tobben[/eluser]
Hi,

first I must give my respect to the guys behind this framework. I really love it so far.


Second: the topic issue. I've just puzzled together something that atleast looks like a event calendar.

It works, _but_ I want to get some feedback on the structure and inprovments for the logic, so I can go further in the learning process.


// THE CONTROLLER (kalender.php)

Code:
class Kalender extends Controller {

    // Constuctor

    function __construct()
    {
        parent::Controller();

        $this->load->library('calendar');
        $this->load->model('kalender_model');
    }

    // index

    function index()
    {
        redirect('kalender/dato/'. date('Y') . '/' . date('m') . '/','location');
    }

    function dato()
    {    
        // Grab some vars

        $cal_year = $this->uri->segment(3);
        $cal_month = $this->uri->segment(4);
        $cal_day = $this->uri->segment(5);


        // Check if is numeric

        if(!empty($cal_year) && ctype_digit($cal_year) == FALSE)
        {
            redirect('kalender/dato/'. date('Y') . '/' . date('m') . '/','location');
        }

        if(!empty($cal_month) && ctype_digit($cal_month) == FALSE)
        {
            redirect('kalender/dato/'. date('Y') . '/' . date('m') . '/','location');
        }

        if(!empty($cal_day) && ctype_digit($cal_day) == FALSE)
        {
            redirect('kalender/dato/'. date('Y') . '/' . date('m') . '/','location');
        }

        // Redirect if empty vars

        if(!$cal_year || !$cal_month)
        {    
            redirect('kalender/dato/'. date('Y') . '/' . date('m') . '/','location');
        }


        // Setup calendar

        $prefs = array (
            'start_day'    => 'monday',
            'month_type'   => 'long',
            'day_type'     => 'abr',
            'show_next_prev'  => TRUE,
            'next_prev_url'   => base_url() . 'kalender/dato/'
            );

        $this->calendar->initialize($prefs);


        // Say hello to the models

        $data['event_data'] = $this->kalender_model->get_events($cal_year, $cal_month);

        // If day isset, get day info

        if($cal_day)
        {
            $data['event_day_data'] = $this->kalender_model->get_day($cal_year, $cal_month, $cal_day);    
        }


        // Tell it to the viewer

        $this->load->view('kalender_view', $data);

    }

}


// THE MODEL (kalender_model.php)

Code:
class Kalender_model extends Model {

    // Constuctor

    function __construct() {

        parent::Model();

    }

    function get_events($year, $month) {

        $first_day = mdate('%Y-%m-%d', mktime(0,0,0,$month,1,$year));
        $last_day = mdate('%Y-%m-%d', mktime(0,0,0,$month,days_in_month($month, $year),$year));

        $this->db->where('event_date >', $first_day);
        $this->db->where('event_date <', $last_day);
        $query = $this->db->get('kalender');

        if ($query->num_rows() > 0)
        {
            foreach($query->result() as $k => $row)
            {
                $key = mdate('%j', mysql_to_unix($row->event_date));

                $data_array[$key] = base_url() . 'kalender/dato/' . $year . '/' . $month . '/' . str_pad($key, 2, '0', STR_PAD_LEFT);
            }

            return $data_array;
        }
    }

    function get_day($year, $month, $day) {

        $first_day = mdate('%Y-%m-%d', mktime(0,0,0,$month,1,$year));
        $last_day = mdate('%Y-%m-%d', mktime(0,0,0,$month,days_in_month($month, $year),$year));
        $current_day = mdate('%Y-%m-%d', mktime(0,0,0,$month,$day,$year));

        $this->db->where('event_date =', $current_day);
        $query = $this->db->get('kalender');

        if ($query->num_rows() > 0)
        {
            foreach($query->result() as $k => $row)
            {
                $key = mdate('%d', mysql_to_unix($row->event_date));

                $data_array[$k]['dato'] = base_url() . 'kalender/dato/' . $year . '/' . $month . '/' . $key;
                $data_array[$k]['body'] = $row->body;
                $data_array[$k]['title'] = $row->title;
            }

            return $data_array;
        }
    }
}



// THE VIEW (kalender_view.php)

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="no" lang="no"&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
    &lt;meta name="robots" content="index,follow" /&gt;
    &lt;meta name="description" content="" /&gt;
    &lt;meta name="keywords" content="" /&gt;

    &lt;title&gt;Title&lt;/title&gt;
    
&lt;/head&gt;

&lt;body&gt;

    <div id="container">

    &lt;?php
    
    echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4), $event_data);
    
    if($this->uri->segment(5)){
        
        foreach($event_day_data as $value) {
            echo '<h2>' . $value['title'] . '</h2>';
            echo '<p>' . $value['body'] . '</p>';
        }    
    }
    
    ?&gt;

    </div>

&lt;/body&gt;
&lt;/html&gt;


Well, that's all folks, and thanks for all the fish.


  there can be only one auto column and it must be defined as a key
Posted by: El Forum - 07-31-2007, 10:38 AM - Forum: Archived Development & Programming - Replies (5)

[eluser]sikkle[/eluser]
Does anyone here already deal with simulation of two or three auto_increment field ?

like

unique id starting at 1
unique serial no starting at 100 000 001
unique client public number starting at 100 000 000 001


How do people deal with this ?

Thanks !



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.