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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 15,070
» Latest member: hanysamy
» Forum threads: 70,371
» Forum posts: 361,981

Full Statistics

Latest Threads
redirect with input
Forum: CodeIgniter 4 Support
25 minutes ago
» Replies: 0   » Views: 3
Looking for opinions RE: ...
Forum: News & Discussion
2 hours ago
» Replies: 4   » Views: 5,771
[split] CodeIgniter 3.1.1...
Forum: CodeIgniter 4 Discussion
3 hours ago
» Replies: 5   » Views: 266
Can a text editor be inte...
Forum: General Help
4 hours ago
» Replies: 11   » Views: 595
CodeIgniter 4 Playground
Forum: News & Discussion
4 hours ago
» Replies: 45   » Views: 49,657
can't create instance of ...
Forum: CodeIgniter 4 Discussion
6 hours ago
» Replies: 6   » Views: 449
help me decide
Forum: Choosing CodeIgniter
10 hours ago
» Replies: 2   » Views: 201
Bug: Double use where and...
Forum: CodeIgniter 4 Support
Yesterday, 11:21 AM
» Replies: 0   » Views: 135
Cookie and other headers ...
Forum: CodeIgniter 4 Support
Yesterday, 09:56 AM
» Replies: 0   » Views: 59
Detect redirect
Forum: CodeIgniter 4 Support
Yesterday, 08:02 AM
» Replies: 1   » Views: 152

 
  gmt_to_local() returns incorrect date
Posted by: El Forum - 06-27-2007, 11:37 PM - Forum: Archived Development & Programming - Replies (8)

[eluser]the real rlee[/eluser]
Hi guys,

I'm having weird issue with the date helper in CI. gmt_to_local() with correct timezone (UP10) is not showing the correct date, however PHP's gmdate IS showing the correct date.

What's possibly wrong here?

FYI Im using XAMPP on my local machine


  noob question
Posted by: El Forum - 06-27-2007, 10:06 PM - Forum: Archived General Discussion - Replies (2)

[eluser]jstrebel[/eluser]
Hey there.. noob here.

I am trying to build a 3 level deep url loading a view at each stage.


My controllor for a user dashboard: dash.php

Code:
function index() {
                $data = array(
                        'morecontent' => '',
                );

                $content = $this->load->view('dash/index',$data,true);
                $this->wrapOutput($content,"Dashboard","dash");
        }
This gives me http://somesite.com/dash

So there is sub section of the dashboard called the account settings

Code:
function settings() {
                
                $data = array(
                        'morecontent' => $this->load->view('dash/settings',array(),true),
                        
                      
                );

                $content = $this->load->view('dash/index',$data,true);
                $this->wrapOutput($content,"Dashboard > Settings","dash");
        }
So above I am loading the settings view into the dash view... and it gives me http://somesite.com/dash/settings

So I want to now load a payment view into settings.. and have the final url be http://somesite.com/dash/settings/payment

My instinct is to create a function called payment() inside of the settings() function.. sort of like nesting folders in a file strcture... but that is not how CI works.

I need to have 3 or 4 subpages inside of settings, that is inside of dash... How best to accomplish this?

Sorry if it does not make sense.. I am thinking like a file system.. if I want to group pages into categories I just nest the file structure... how does one nest functions in a controllor to created nested url's?

It is important for us to use this 3 level structure as /dash will have many 2nd level pages which in turn have more 3rd level pages. like /dash/profile/bio and /dash/profile/privacy etc.


  Validation problem, maybe server problem
Posted by: El Forum - 06-27-2007, 09:32 PM - Forum: Archived Development & Programming - Replies (5)

[eluser]Référencement Google[/eluser]
Hi,

I get a problem with a simple form to validate.
In local it's perfectly working, but once on the prod server, impossible to make it work.

In my view form i have things like:

Code:
<?=$this->validation->prenom_error?>

And once on the production server, i get errors like :

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: prenom_error

Filename: contact_form/contact_form.php

Line Number: 8

Can somebody help me ?


  How to call functions of another controller
Posted by: El Forum - 06-27-2007, 08:33 PM - Forum: Archived Development & Programming - Replies (41)

[eluser]yongkhun[/eluser]
Is there a way to call the functions of another controller from a different controller? I try to do like $this->another_controller->function1() but error said "calling function on non-object". How? Thanks!


  Is this correct way...
Posted by: El Forum - 06-27-2007, 03:25 PM - Forum: Archived General Discussion - No Replies

[eluser]mk3[/eluser]
I found solution. how to include in every page login form, but do not really know if it is correct. the method I used is I auto loaded library. and the library constructor is doing the following:

Code:
class Authorize {
    
    //constructor    
    function Authorize(){
        $this->CI =& get_instance();
        $this->CI->load->library('MySmarty');
        $this->CI->load->library('session');
        $this->CI->mysmarty->assign('login_errors', null);
        $this->CI->mysmarty->assign('user', $this->CI->session->userdata('user_data'));
        $this->CI->mysmarty->assign('logged_in', $this->CI->session->userdata('logged_in'));
        if (isset( $_POST['submit']) && $_POST['submit'] == 'Login'){
            $this->login();    
        }
    }

So when login form is submitted authorize library calls function which then processes login.

What it is interesting for me am I doing the right way. It seems OK for me, but I believe there are/can be some issues why this cannot be done.

Also would be nice to hear suggestions and critics.


  use of array data in views
Posted by: El Forum - 06-27-2007, 12:52 PM - Forum: Archived Development & Programming - Replies (2)

[eluser]pmonty[/eluser]
My array looks like this:

Quote:$formdata('sort'=>'perf-desc')
I am loading the view like this:
Quote:$this->load->view('testform',$formdata);
My view code looks like this:
Quote:Sort By: <select name="sorton">
<option value="perf-desc" &lt;?= if ($sort =="perf-desc") ? "selected='selected'" : "selected=''";?&gt; >Perf Desc</option>
</select>
Obviously I am doing something syntactically wrong to get this error:
Quote:Parse error: syntax error, unexpected T_IF in \system\application\views\testform.php on line 10

How should this be coded?

Paul


  Calender Lib for JS Form Input?
Posted by: El Forum - 06-27-2007, 11:07 AM - Forum: Archived Development & Programming - Replies (1)

[eluser]Phil Sturgeon[/eluser]
Anyone made a nice little form input GUI for dates in a form?

Would love something similar to phpMyAdmins calender view (that's the first example that came to mind) so instead of having multiple dropdowns or just a text input box i could have a lovely calender view.


  log files
Posted by: El Forum - 06-27-2007, 09:43 AM - Forum: Archived General Discussion - Replies (1)

[eluser]Unknown[/eluser]
Is there something comparable to like an OC4J(java) log for CI? It would be beneficial when developing if I could see what is executing.

Suggestions are greatly appreciated.

Thanks.


  Email library : mail() function issue
Posted by: El Forum - 06-27-2007, 09:21 AM - Forum: Archived Development & Programming - Replies (11)

[eluser]metalking[/eluser]
Hi everybody!

I'm just trying to build a mail module for my application (some kind of newsletter), and I'm having some problems with the Email library.

When I try to send a mail using the method described in the user guide, I get a PHP warning, saying that in libraries/Email.php, at line 1232, the mail() function receives a wrong number of parameters.

My CI code :

Code:
$this->load->library('email');

$emailconfig['protocol'] = 'smtp';
$emailconfig['smtp_host'] = 'smtp.gmail.com';
$emailconfig['smtp_user'] = 'username';
$emailconfig['smtp_pass'] = 'password';
$emailconfig['smtp_port'] = '465';

$this->email->initialize($emailconfig);

$this->emails = $this->get_emails($this->validation->destinataires);
foreach($this->emails as $email)
{
$this->email->from('metalking.designer@gmail.com', 'The Polygon\'s Battle');
$this->email->reply_to('metalking.designer@gmail.com', 'metalking');
$this->email->to($email['email']);

$this->email->subject($this->validation->sujet);
$this->email->message($this->validation->message);

if($this->email->send())
{}
else
$this->mailerror = 1;
                    
$this->email->clear();
}

Don't care about vars names and so on, the only error I get (at the moment) is this PHP error, which says CI sends a wrong number of parameters to the mail() function.

Have you any idea of what the problem is?


Thanks ! Wink


  Invisible mysql row
Posted by: El Forum - 06-27-2007, 08:07 AM - Forum: Archived Development & Programming - Replies (3)

[eluser]xwero[/eluser]
When i do an insert with the same code but other values the row doesn't get displayed in the table but the auto_increment has gone up a number and the code igniter affected_rows function displays 1.

I have seen this behaviour before but i never knew what caused this, it disappeared somehow. I'm working with mysql version 3.23 (shared hosting)

I hope someone can explain this and offer a solution, i searched for it but i haven't found one.



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