Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all 14348 articles
Browse latest View live

Syntax error, parse error, unexpected

$
0
0
Hello

I am getting the following message:

Parse error: syntax error, unexpected 'yield' (T_YIELD) in /home2/angelsc4/public_html/admin/bonfire/themes/default/index.php on line 8

the code is
<?php echo theme_view('parts/_header'); ?>


<div class="container body narrow-body"> <!-- Start of Main Container -->

<?php

    echo Template::message();
    echo isset($content) ? $content : Template::yield();
?>

<?php echo theme_view('parts/_footer'); ?>






can anyone suggest how to resolve this problem

learn

$
0
0
I am a student, I am learning from the source code that I downloaded for free from the internet, the name is the personnel management system, I want to make a blinking notification when the employee is going to get promoted, can you help me !?

A Package and Dependency Manager for Code Igniter.

$
0
0
I'd like to know what the you guys think of a package and Dependency Manager for Code Igniter.

I've currently built and released one with it's terminal tools on https://splint.cynobit.com though still alpha but it gets the job done.

In a nutshell, one can distribute packages with the Code Igniter application folder directory structure. 

For example, the root folder of a Code Igniter package contains folders like models, views, configs, libraries, etc.

Other future capabilities include:
  • Application packages
  • Web Template Packages (For distributing website templates prepared for Code Igniter)
  • Shields.io Integrations for use in README files.
  • And more
At the moment, it has an SDK (The package manager works by extending your Loader class with a MY_Loader.php file in your application/core folder.

I also have plans for Code Igniter 4 although i know Composer is kind of killing it there. However, I think that from the documentation, Splint can do something in the area of Code Modules.

Please forgive me if I've posted this in the wrong thread.

XMLRPC over https

$
0
0
Hello...
.
I having problem when use xmlrpc on client which will access XMLRPC server using https...
.
[Code Snippet]
[Image: 5FwJPYRrS5u-xLl-jBP-lg.png]

[Error]
[Image: JT2Sr1Q.jpg]

Please helpme to use xmlrpc over ssl on codeigniter..
.
Thanks

Codeigniter project is not running in locahost

$
0
0
My project is already hosted on a live server, I want to host it on a local server so that I can do experiments in that, but it is not hosting in local server. can you please tell me the solution for that.

CI4 - Unable to Autoload Markdown Class

$
0
0
I am in the process of trying to use CI4 for an existing PHP program that utilises MarkDown.

In accordance with the CI4 Manual I have added the following to /app/Config/Autoload.php
PHP Code:
        /* Files available:
            Markdown.inc.php
            Markdown.php
            MarkdownExtra.inc.php
            MarkdownExtra.php
            MarkdownInerface.inc.php
            MarkdownInerface.php
        */
        
$fff '/var/www/ci2/php-markdown/Michelf/MarkdownExtra.inc.php';    
        
$classmap = [
         
        'Markdown' => $fff
        
];        
        
// $classmap = []; // ORIGINAL SCRIPT 

Unfortunately I am unable to use CI4 way of using Markdown

I can only get it to work using require_once('Class_MarkDown.php); ...

...as can be seen in the following class:
PHP Code:
<?php 
declare(strict_types=1);

namespace 
App\Controllers;

use 
CodeIgniter\Controller;
# use App\Models\UserModel;

require_once '/var/www/ci2/php-markdown/Michelf/MarkdownExtra.inc.php';
use 
Michelf\MarkdownMichelf\SmartyPants;
// use Markdown, Michelf\SmartyPants;
// use Markdown, SmartyPants;
// use Markdown;

# ==========================================================
class Home extends BaseController
{

# ==========================================================
public function index()
{
 
 // $fff = file_get_contents(WRITEPATH .'markdown/BLURB-head.md');
 
 $fff  '## Markdown test to see if H2 works OK';

 
 $txt Markdown::defaultTransform($fff);
 
   
  $body 
'<div class="tal bd4 p42">'
 
         $txt
        
'</div>'
 
       ;

 
 $data['header'] = $this->header();
 
 $data['body'  $body;
 
 $data['footer'] = $this->footer();

    return 
view('v_home'$data);
}
//


}///
# ========================================================== 

TO UPLOAD PSV [PIPE SEPARATED VALUE FILES] FILES INSTEAD OF IMAGES ... WHAT HAVE TO D

$
0
0
https://codeigniter.com/user_guide/libra...xt%20files





File Uploading Class








TO UPLOAD PSV [PIPE SEPARATED VALUE FILES] FILES INSTEAD OF IMAGES ... WHAT HAVE TO DO HERE???? i did this put file Not accepted too getting ... well?????





              $config['upload_path']          = './uploads/'; 

                $config['allowed_types']        = 'psv';  

                $config['max_size']             = 100;

                //$config['max_width']            = 1024;
                //$config['max_height']           = 768;

Rewriting the documentation of the MIT licensed framework

$
0
0
Does writing a tutorial framework licensed by MIT require written permission?

I want to write a codeigniter tutorial in my language, based on my experience while still referring to the official Codeigniter documentation, is that okay?

i need help in mysql like query

$
0
0
how to write the direct mysql statement in CI model
for ex:-
   
      SELECT
    employeeNumber, lastName, firstName
FROM
    employees
WHERE
    (lastName LIKE '%B%' or firstName LIkE '%d%') and employeeNumber LIKE '%112%' and (Country LIKE '%US%' or Country LIkE '%UK%');

this statement is mysql formate

how to write the same logic in the CI model,
kindly i request to help me.
thanking you

getting property of non-object error

$
0
0
Severity: Notice --> Trying to get property of non-object



Here is the code






 

PHP Code:
function company_update($row)
{
 
   $userid=$this->session->userdata('userid');

 
   $query=$this->db->get_where('campaigns2',array('id'=>$row));

 
   $campaign $row->company_division;

 
 //  $campaign = $row->company_division;
 
   $this->session->userdata('campaign')-> $campaign;   << line with error
    $this
->db->set('campaign'$campaign);
 
   $this->db->where('email'$userid);
 
   $this->db->update('users'); 

This code seems to run fine on my windows apache and also on my AWS Lightsail server. Why would it be different on Ubuntu? I am thinking that I copied the campaigns2 table from the windows PC. Perhaps things got out of sync? Confused

Migrations in modules?

$
0
0
Hi guys.

Just trying to get a module migration working and seem to be having a bit of bother.

I have done exactly what is described in the following article ...

Modules_in_CodeIgniter_4

Now my question is, in the migration file, what namespace am I supposed to be using?

And, they are supposed to just work right? no more configuring?

Thanks

Database query very slow with just one addition

$
0
0
Hi,

I have this query that runs very slowly (nearly 8 seconds). When I remove a single WHERE statement it runs very fast (0.02 seconds). I think it might be something to do with the where statement being a string comparison on a joined table. Does anyone know why this would be.

Very Slow Query
PHP Code:
$products $this->db->from('products')
 
  ->select('product_id, product_model, product_url, product_short_name, product_supplier_id, product_google_feed, product_colour_variations, product_live, pcolour_full_model, mp_model, mp_leisurebench_item')
 
  ->join('brands''products.product_brand_id = brands.brand_id''LEFT')
 
  ->join('product_colours''products.product_model = product_colours.pcolour_model''LEFT')
 
  ->join('netsuite_master_product_list''(products.product_model = netsuite_master_product_list.mp_model OR  product_colours.pcolour_full_model = netsuite_master_product_list.mp_model)')
 
  ->where('mp_leisurebench_item''No' // This line appears to be the culprit
 
  ->group_start()
 
     ->where('product_supplier_id'0)
 
     ->or_where('brand_on_netsuite'1)
 
  ->group_end()
 
  ->get()
 
  ->result_array(); 
 

When I remove the line "->where('mp_leisurebench_item', 'No')" the query is very fast.

In the end I removed that line and did a foreach loop to unset the unwanted data but am still confused about why this one WHERE statement would slow this query so considerably. I would clearly use a binary TRUE/FALSE normally but the data is coming from another system that outputs a string "No" or "Yes" which I have no control over unfortunately.

Just curious if anyone knows why this would happen.

Thanks in advance,

Paul.

Calling a MySql function

$
0
0
I have created a function in mysql called NextVal that requires a string parameter and returns an integer.
I tried the following code:
Code:
public function next_value() {
    $ci =& get_instance();
    $sql = 'SELECT nextval(?) as receipt_id';
    $query = $ci->db->query( $sql, array( $this->sequence_name ) );
    return $query->row()->receipt_id;
}

Codeigniter logs the following error:
ERROR - 2019-04-28 19:16:55 --> Query error:  - Invalid query: SELECT nextval('receipt_id_seq') as receipt_id

However, if I paste and run the select statement shown in the error in MySql Workbench it returns the expected integer value under the column name receipt_id

controllers/News.php

$
0
0
I am busy to teach myself Codeigniter and to lean it form the Codeigniter website.

And I keep on getting this error code when trying to test run the news.php page.

 An uncaught Exception was encountered
Type: ParseError
Message: syntax error, unexpected '$this' (T_VARIABLE)
Filename: C:\wamp64\www\aircomp.co.za\application\controllers\News.php
Line Number: 9
Backtrace:
File: C:\wamp64\www\aircomp.co.za\index.php
Line: 315


Please could somebody help me.

Angry

Database Timestamp ?

$
0
0
Hi guys

Quick question regarding database automatic timestamps.

From the User Guide ...


Quote:$useTimestamps

This boolean value determines whether the current date is automatically added to all inserts and updates. If true, will set the current time in the format specified by $dateFormat. This requires that the table have columns named ‘created_at’ and ‘updated_at’ in the appropriate data type.




Quote:$dateFormat

This value works with $useTimestamps to ensure that the correct type of date value gets inserted into the database. By default, this creates DATETIME values, but valid options are: datetime, date, or int (a PHP timestamp).


Which do you use and why?

Does the datetime option use the MySql timestamp, or is this not used at all.

Thanks

[feature] Email module

$
0
0
Thank you all for participating in the Email third part provider poll.
Our email implementation is in progress, but not the highest priority compared to the 4.0.0 release.

Planned so far:
[x] separate Email\Email class, which encapsulates an Email entity
[x] Email\TransporterInterface, which abstracts the behavior of a mail transport agent, or a wrapper for same, or even an external email service
[.] Email\Handlers\BaseHandler, which implements the common methods of a Transporter
[.] Email\Handlers\MailHandler, which uses (PHP)mail to send emails; was in CI3
[.] Email\Handlers\SendmailHandler, which uses sendmail to send emails; was in CI3
[.] Email\Handlers\SMTPHandler, which uses SMTP to send emails; was in CI3
[.] Email\Handlers\PHPMailer, adapter for 3rd party module suggested by poll
[.] revised user guide writeup for handling email
[x] unit testing for Email\Email
[.] unit testing for Email\Handlers\...
[ ] using an external email testing service for unit testing; leaning towads https://mailcatcher.me/

----------------------------------------------------
This is a roadmap feature, or "epic", and a card on the roadmap board.
Component tasks will show up as issues or PRs on the development board.
We welcome comments & suggestions below.

PHPMailer looks like an important choice for the CodeIgniter community, and a complete solution.

The big difference between PHPMailer and the in-progress Email module for CodeIgniter4 is that we have separated the Email and the handling classes, unlike PHPMailer and the CI3 implementation, which bundle them together into a single class (with supporting classes).

We could just use PHPMailer and be done with it, or we can continue on the current path, which would allow the use of a number of mailers with minimal code change.

What do you think?

Codeigniter Library Language

"testing" Error

$
0
0
I get the following when my environment is set to "testing":

Code:
Warning: Use of undefined constant SUPPORTPATH - assumed 'SUPPORTPATH' (this will throw an Error in a future version of PHP) in /opt/lampp/htdocs/system/Config/AutoloadConfig.php on line 96

Warning: Use of undefined constant SUPPORTPATH - assumed 'SUPPORTPATH' (this will throw an Error in a future version of PHP) in /opt/lampp/htdocs/system/Config/AutoloadConfig.php on line 192

Warning: Use of undefined constant SUPPORTPATH - assumed 'SUPPORTPATH' (this will throw an Error in a future version of PHP) in /opt/lampp/htdocs/system/Config/AutoloadConfig.php on line 193

I'm using beta 1. Where is SUPPORTPATH supposed to be defined?

Good news is everything seems to work fine in development mode.

Xdebug error

$
0
0
What does this error mean?

Cannot accept external Xdebug connection: Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'

How do I get rid of it on Ubuntu?

Protecting a CI site

$
0
0
Hi All,

It seems like the protections in CI are pretty good.  From what I can see/read:

Remote execution:  This can be handled with careful crafting of htaccess and the fact that CI files all start with the "no direct script access" code.

SQL injection:  Seems to be handled by the post methods in CI which filters for this.  Is this correct?

XSS attacks.  Seems to be a built in filter in CI takes care of this.

I also see the DB class has escape functions.  

So all the posts on the web about needing/requiring PDO seem like perhaps CI can take care of most all concerns.

What else are people doing?

My plans for our site are:

1) Registrations will be protected so that the same IP can't flood the system with registration requests.  IE registering too fast.
2) Registrations require a valid email to complete or they automatically delete in 7 days.
3) I plan to use all hints in CI about how to fill data in SQL statements to prevent security holes
4) MD5 for passwords
etc.

Just wondering what the masses using CI are doing as well to make robust strong sites.

thanks in advance!
Viewing all 14348 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>