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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,684
» Latest member: gresakg
» Forum threads: 66,026
» Forum posts: 414,583

Full Statistics

Latest Threads
Multiple Template
Forum: General Help
1 hour ago
» Replies: 2   » Views: 70
Cron job issue - No direc...
Forum: General Help
8 hours ago
» Replies: 2   » Views: 58
What is the best way to f...
Forum: General Help
9 hours ago
» Replies: 0   » Views: 34
External Call Controller ...
Forum: General Help
Yesterday, 09:54 PM
» Replies: 2   » Views: 101
Problem with sending emai...
Forum: General Help
Yesterday, 05:38 PM
» Replies: 8   » Views: 183
Why does a syntax error i...
Forum: General Help
Yesterday, 04:40 PM
» Replies: 0   » Views: 50
validation for image file...
Forum: General Help
Yesterday, 10:51 AM
» Replies: 1   » Views: 98
How CodeIgniter close db ...
Forum: Libraries & Helpers
Yesterday, 10:46 AM
» Replies: 6   » Views: 515
invisible recaptcha
Forum: Addins
Yesterday, 09:35 AM
» Replies: 0   » Views: 78
How long will CodeIgniter...
Forum: General Help
Yesterday, 09:02 AM
» Replies: 5   » Views: 169

 
  What is the best way to fill an object with data from a database
Posted by: phpforever2017 - 9 hours ago - Forum: General Help - No Replies

Hi all

What is the best way to fill an array objects with data from a database

My code

PHP Code:
class ProductsContentComposite extends AbstractContentComposite {
 
   public function addElement(InterfacePrototype $element)
 
   {
 
       $this->elements[] = $element;
 
   }

In Controller
PHP Code:
$productsComposite = new ProductsContentComposite();
/* some logic */
$results $this->product_model->getAll();
$productPrototype = new ProductContentPrototype();
/* some logic */
foreach ($results as $result)
{
$clonePrototype = clone $productPrototype;
/* some logic */
$productsComposite->addElement($clonePrototype);

Is this the right way or not?


  Multiple Template
Posted by: anggaand123 - 11 hours ago - Forum: General Help - Replies (2)

Hello all
i want to ask about how can posible we build template system like wordpress template.
so user can make their own template and just upload it the file to the backend


  Cron job issue - No direct script access allowed
Posted by: window077 - 11 hours ago - Forum: General Help - Replies (2)

Hi, I'm having trouble getting a cron job to run:

=====


The file that I need the cron to run is located at:

Code:
/home/user/public_html/application/modules/cron/controllers/cron.php

The command for the cron is:
Code:
/usr/local/bin/php /home/user/public_html/application/modules/cron/controllers/cron.php Cron index

The file cron.php contains:
<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Cron extends Front_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('cron_model');
    }

    public function index() {
        $this->check_on_grace_period(); //checks for grace period if passed disable account
    }
}

The error after the cron runs is:
No direct script access allowed

=====

What am I doing wrong?  Any help would be amazing, thanks Smile


  Why does a syntax error in a NOT requested controller bring down a whole CI app?
Posted by: flechamobile - Yesterday, 04:40 PM - Forum: General Help - No Replies

Hey,

So I ran into a situation where a test controller had a stupid syntax error and it brought down the whole app.
This test file was accidentally pushed onto live and brought everything offline..

Now few questions:
1. Why is it that a syntax error in a controller which is NOT requested and not included or anything bring down the whole app?
Are all controllers loaded - always-? I thought CI did lazy loading? Only load what is needed when its needed?

2. Is there anyway we can prevent this ?
(other then obviously making sure testing controller doesn't get pushed to live w/o first checking it on dev)

3. Prob unrelated to CI; but on live we have error reporting turned off via the bootstrap file of course..
However this syntax error was also NOT logged in nginx error logs at all... (using php-fpm) if anybody has any idea about that please do shoot..

Thank you!
Steven


  invisible recaptcha
Posted by: visualsol - Yesterday, 09:35 AM - Forum: Addins - No Replies

For anyone who has a need for the new invisible recaptcha, there is a new library that I've added Codeigniter usage instructions for.

https://github.com/albertcht/invisible-recaptcha

Hope it helps someone!
Bob


  validation for image filed
Posted by: programmer - Yesterday, 07:57 AM - Forum: General Help - Replies (1)

hi
i need too when image is empty form submit 
but image field is not empty checked .
if image uploaded submit form 
if image not uploaded form don't submit and return error with validation method
please help


  Problem with sending email on SMTP
Posted by: StratoKyke - Yesterday, 07:19 AM - Forum: General Help - Replies (8)

Hi,
I use an  OVH e-mail and the following configuration:

email.php

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'SSL0.OVH.NET';
$config['smtp_port'] = '587';
$config['smtp_user'] = 'email';
$config['smtp_pass'] = 'pass';
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
$config['send_multipart'] = FALSE

When I need to send an email use this part of code

PHP Code:
$this->load->library('email');
            
$this->email->from($admin$name);
            
$this->email->to($email);
            
$this->email->subject('text');
            
$this->email->message('text');
            
$this->email->send(); 

The error that is returned to me is:

Code:
220-ssl0.ovh.net player773
hello: 220 ssl0.ovh.net player773
The following SMTP error was encountered: 220 ssl0.ovh.net player773
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

User-Agent: CodeIgniter
Date: Sat, 27 May 2017 15:10:51 +0200
From: "Email - email" <email>
Return-Path: <email>
To: email2
Subject: =?UTF-8?Q?test?=
Reply-To: "email" <email>
X-Sender: email
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

test


I can not figure out what the problem may be.

Emails through ovh from another cms go quietly. Only codeigniter from this error.


EDIT: Codeigniter V.3.0.4

EDIT2: I updated codeigniter to V .3.1.4 and I always have the same problem


  How long will CodeIgniter 3 be supported for?
Posted by: reactionstudio - Yesterday, 03:40 AM - Forum: General Help - Replies (5)

When CodeIgniter 4 is released, how long will CodeIgniter 3 be supported with bug fixes and security patches for?


  Secure Login
Posted by: [email protected] - 05-26-2017, 08:44 AM - Forum: General Help - Replies (6)

New to CI and wondering can someone point me in the right direction regarding a secure user login module/library/tutorial

Just needs the general functionality one would expect from a user account.

Cheers


  Asking for help or asking for free build time
Posted by: Martin7483 - 05-26-2017, 04:03 AM - Forum: Lounge - Replies (12)

Hi,

I love CI and love all the hard work that we all do and post here to help each other. And I like helping out where I can.

But lately it seems there are more and more forum members that don't seem make an effort or take the time needed to study the very easy to read and use CI documentation. A lot also don't even seem to have a basic understanding of PHP, HTML, CSS or JavaScript.

Like I said, I'm all for helping, but when a member starts asking things like this

Quote:Can anybody provide me with simple coding for (1) Inserting & Submitting an email address and sending the Code. and (2) Inserting & Submitting the code and moving to the username & password page. and (4) Sending the extended username & password to the email address?

I get annoyed.

It's like asking, I want this, can you build it for me and I will take all the credit for your work.

Do these members have a place here? What do other members here think of this issue?

Kind regards,
Martin



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