Codeigniter - Undefined Variable: Config. Error But Email Is Sent?

I just downloaded version 2.0.1 of CodeIgniter framework and I am attempting to write my own email controller like so:


class Email extends CI_Controller
function __construct() { parent::__construct(); }[code]....

In spite of the PHP error, email is being sent fine, with a file attachment.How can I remove this PHP error? What am I doing wrong?


CodeIgniter - Accessing $config Variable In View?

Pretty often I need to access config variables in views. I know I can pass them from controller to load->view(). But it seems excessive to do it explicitly.

Is there some way or trick to access $config variable from CI views without disturbing controllers with spare code?

View 5 Replies View Related

CodeIgniter - Weird Echo Of $config Coming Back When Load Email Library

Version info: CI version 1.7.2 - PHP 5.3.1 - Apache2 - Mac OSX 10.6.3

For some reason, when I load CI's email library, either in my controller, or in autoload.php, it automatically and immediately echoes the config info like so:

$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE

If I autoload the email library in autoload.php, it is echoed before anything else in my source/page. If I call it explicitly within my controller, it's echoed at that exact point.

View 1 Replies View Related

Codeigniter: Access Config Variables From Other Config Files?

I have two config files.

config.php (code igniters core config)

and email.php (autoloaded by the email class when it is used)

What i am wanting to do is.

In config.php have

$config['env'] = 'hailwood_dev';

then in email.php have

if($config['env'] == 'hailwood_dev'){
//email variables like smtp server to do with localhost
} elseif($config['env'] == 'production'){
//email variables like smtp server to do with production

But this is not having any effect (im guessing as $config['env'] does not have those values).

How can I access this value?

View 3 Replies View Related

CodeIgniter 'Undefined Variable'?

This is probably an easy one but I barely got any sleep last night and am struggling to comprehend anything.I've got a CodeIgniter library I've made called Points.php. Here's the contents of Points:

<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Points

As you can see, I'm building it up slowly and it's being kept simple.In one of my views, I want it to display the number of 'points' (which for the time being is simply the third segment of the URI). I call it like this:

<p>Points: <?php $params['user_id']=$this->uri->segment(3,1); echo $this->points->getpoints($params); ?></p>

The warning I get back in the view is this:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: userid

Filename: libraries/Points.php

Yes I know it's such a simple problem but I've tried lots of things. Some variations include echoing in Points.php $params['userid']; etc. But I don't see what I'm doing wrong?

View 2 Replies View Related

Codeigniter Model Error : Undefined Property?

I am new to codeigniter model, i try to follow steps in docs to load all user registered in my db.This is my model: user.php

class User extends Model {
function user() {
parent::Model(); [code]....

it showing error:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: User::$db

Filename: models/user.php

Line Number: 30

Fatal error: Call to a member function query() on a non-object in G:xampphtdocsfiksisystemapplicationmodelsuser.php on line 30

Line 30 see comment above...

View 3 Replies View Related

CodeIgniter Error - Undefined Property: CI_Input::$post

I'm new to CodeIgniter and am trying to use the conditional below to determine whether or not the form has been submitted, and then display a certain view if it has. I got the error in the title for some reason and have been troubleshooting the problem for more than half and hour.

// load view if form was submitted
} else {
// load other view

View 2 Replies View Related

CodeIgniter Error - Undefined Property And CI_Input::$post?

CodeIgniter and trying to use the conditional to determine whether or not the form has been submitted, and then display a certain view if it the error in the title for some reason and have been troubleshooting the problem for more than half and might go about solving this problem?

// load view if form was submitted
} else {
// load other view


View 2 Replies View Related

Fatal Error: Call To Undefined Method CI_DB_mysql_driver::result() - CodeIgniter?

I have CodeIgniter error below,

function check_email()

why is it when i include th result() method it show an error mesage?

View 3 Replies View Related

Run Page On WAMP Server Which Include Session Variable But It Is Giving An Error : Undefined _SESSION Variable?

I am trying to run my live page on WAMP server which include session variable but it is giving a Error:undefined _SESSION variable

View 2 Replies View Related

Undefined Index Error In Email Form

Can anyone help a newbie understand how a 'send email form' works? Want to have the form send the data to itself and validate the data before displaying a confirmation page. Seems easy enough.

Am using <FORM method='POST' action='$PHP_SELF'> to send the form back to itself.

The system gives an 'undefined index' error when the code tries to access the POST array eg. $test=$_POST['submit']; Have tried $_POST['submit'], $HTTP_POST_VARS['submit'], have checked whether the arrays are empty (they are) have tried global_variables on and off. Can't seem to get it working. Code:

View 5 Replies View Related

Undefined Variable Error & Fatal Error?

I am trying to execute the below code but getting these errors : Notice: Undefined variable: mysql_query in C:wampwwwprocess.php on line 16Fatal error: Function name must be a string in C:wampwwwprocess.php on line 16

mysql_select_db("encryption") or die(mysql_error());

View 1 Replies View Related

Codeigniter Email Error Handling?

The CI Email send() function only returns true or false. Is there a way to get a more detailed reason as to why a sending failed? I'm using SMTP.

View 3 Replies View Related

Variable Undefined Error

<form enctype="multipart/form-data" action="loadmeup.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="300000">
<input name="userfile[]" type="file" /><br />
<input name="userfile[]" type="file" /><br />
<input type="submit" />

View 1 Replies View Related

PHP 5 Undefined Variable Error

Well I just upgraded to PHP 5 but now no variables will pass page to page like I use to have them do and im getting error messages that say undefined variable bla bla bla. I think this is a quick fix by changeing something in php.ini. I just dont know what to change any ideas?

View 2 Replies View Related

Email - In CodeIgniter - Error Messages Emailed To Me?

I'd like to receive error logs via email. For example, if a Warning-level error message should occur, I'd like to get an email about it.

How can I get that working in CI ?

View 5 Replies View Related

Undefined Variable _SERVER Error


echo('<p>' . $_SERVER['PHP_SELF'] . '</p>');


this is my code. Whenever I try to view it in the Browser I am getting the following error:

Warning: Undefined variable: _SERVER in c:inetpubwwwrootphpincludesincludessimpleParagraph.php on line 3 ...

View 1 Replies View Related

Undefined Index/Variable Error

I keep getting errors like: Code:

Undefined index: mail in C:Program FilesApache GroupApache2htdocs est.php on line 3

and Code:

Undefined variable: _session in C:Program FilesApache GroupApache2htdocsindex.php on line 198

What does Undefined Variable and Undefined Index mean?

View 7 Replies View Related

Undefined Variable Error Change In The .ini

I looked at my Apache Error Log today and saw thousands of lines with something like: Undefined variable: var_name Why is it complaining about variables I don't define? Is there a setting I have to change in the .ini I'm unaware of.

View 8 Replies View Related

Error - Undefined Variable: _SESSION

I use _SESSION in many parts of my application, but for some reason, my error logs keep having this line in there:

Undefined variable: _SESSION

View 2 Replies View Related

Getting Error Notice: Undefined Variable

Im new to php so im sure this is an easy one. Im getting this error Notice: Undefined variable: conn in C:DevWebserverApache2.2htdocsEclipsePHP hecockphpdb.php on line 23 for this code


View 2 Replies View Related

Error: Notice: Undefined Variable

can anyone notice any errors in this code:


I'm getting this error: Notice: Undefined variable: msg_id in C:wampwwwstream_scriptsdraft2ajax_more.php on line 20 Call Stack #TimeMemoryFunctionLocation 10.0012373824{main}( )..ajax_more.php:0 " class="morebox"> ( ! ) Notice: Undefined variable: msg_id in C:wampwwwstream_scriptsdraft2ajax_more.php on line 21 Call Stack #TimeMemoryFunctionLocation 10.0012373824{main}( )..ajax_more.php:0 " class="more">more

View 5 Replies View Related

Error When Sending Smtp Email With Google And Codeigniter?

trying to make a reset password function for my website however I cant get past sending an email without this error occuring.

Unable to send email using PHP mail().Your server might not be configured to send mail using this method.I am using gmail as the host to send the email. Here is the part of the function that is used to send the email.

$user_email = $this->input->post('email_address');

$query = $this->db->get_where('account', array('email_address' => $user_email));
if($query) {[code].....

I am also getting this error::

Message: Undefined index: Subject

View 3 Replies View Related

Isset($variable) Gives Undefined Veriable Error

Why would

if (isset($variable)){do stuff;}

give an 'undefined veriable' error?

That's the reason I put it in there, to avoid that!

View 2 Replies View Related

Rookie, Receiving An Undefined Variable Error?

I am reading a book and going through the examples, unfortunately i keep getting an error if i leave a field empty when i submit the form. I checked the errata and there was nothing, i tried posting on the books forums but I didn't get any responses.

I believe that maybe i have to declare the variables first but that would take away from the variables being automatically generated.

$expected = array('name', 'email', 'comments');
$required = array('name', 'email', 'comments');
foreach ($_POST as $key => $value){
//assign to temporary variable and strip whitespace if not an array
$temp = is_array($value) ? $value : trim($value);
//if empty and required, add to $missing array
if (empty($temp) && in_array($key, $required)){
$missing[] = $key;
} elseif(in_array($key, $expected)){
//otherwise, assign to a variable of the same name as $key
${$key} = $temp;
$errors = array();
$missing = array();
//Check to see if the form has been submitted
if (isset($_POST['send'])){
//email processing script
$to = ''; //use your email address
$subject = 'Feedback from Japan Journey';
//list expecting fields
$expected = array('name', 'email', 'comments');
//set required fields
$required = array('name', 'email', 'comments');
<meta charset=utf-8">
<title>Japan Journey<?php if (isset($title)){echo "&#8212;{$title}";} ?></title>
<link href="styles/journey.css" rel="stylesheet" type="text/css" media="screen">
<div id="header">
<h1>Japan Journey</h1>
<div id="wrapper">
<?php include('./includes/'); ?>
<div id="maincontent">
<h2>Contact Us</h2>
<?php if ($missing || $errors){ ?>
<p class="warning">Please fix the item(s) indicated.</p>
<?php } ?>
<p>Ut enim ad minim veniam, quis nostrud exercitation consectetur adipisicing elit. Velit esse cillum dolore ullamco laboris nisi in reprehenderit in voluptate. Mollit anim id est laborum. Sunt in culpa duis aute irure dolor excepteur sint occaecat.</p>
<form id="feedback" method="POST" action="">
<label for="name">Name:
<?php if ($missing && in_array('name', $missing)){ ?>
<span class="warning">Please enter your name</span>
<?php } ?>
<input name="name" id="name" type="text" class="formbox"<?php
if ($missing || $errors){
echo ' value="' . htmlentities($name, ENT_COMPAT, 'UTF-8') . '" ';
} ?> />
<label for="email">Email:
<?php if ($missing && in_array('email', $missing)){ ?>
<span class="warning">Please enter your email address</span>
<?php } ?>
<input name="email" id="email" type="text" class="formbox"<?php
if ($missing || $errors){
echo ' value="' . htmlentities($email, ENT_COMPAT, 'UTF-8') . '" ';
} ?> />
<label for="comments">Comments:
<?php if ($missing && in_array('comments', $missing)){ ?>
<span class="warning">Please enter your comments</span>
<?php } ?>
<textarea name="comments" id="comments" cols="60" rows="8"><?php
if ($missing || $errors){
echo htmlentities($comments, ENT_COMPAT, 'UTF-8');
} ?></textarea>
<input name="send" id="send" type="submit" value="Send message">
<?php if ($_POST && $missing) {print_r($_POST);} ?>
<?php include('./includes/'); ?>

View 3 Replies View Related

Code Generates Undefined Variable Error?

wing code generates undefined variable error?Error:

Notice: Undefined variable: abc in D:xampphtdocs est2.php on line 6

View 4 Replies View Related

Install PhpLinks And Other CMS - Getting Error: Undefined Variable

I tried to install couple of ready-to-use php programs, such as phpLinks and other CMS. The error messages would showed up with part of working page:"Undefined variable", even thought the "register_globals = off" in my php.ini file. How could I fix it?

View 10 Replies View Related

Linux - Ignore Undefined Variable Error?

I recently setup a new web server and I'm getting undefined variable error.If I use variables without initializing, it gives me an error.The source code did not change. Only the LAMP environment did.

View 2 Replies View Related

Login Page, Error Undefined Variable

i'm doing a webpage login with php5, mysql4 and apache2.2.4. I copy this code from a book and change some of the code a bit. When i try to run it gave me

"PHP Notice:  Undefined variable: message in C:Program FilesApache Software FoundationApache2.2htdocsWebpageLoginPage.Php on line 70"

Its the last line of the code "<?php echo $message; ?>"

Why is it undefined? Code:

View 4 Replies View Related

'PHP_SELF' And 'Submit' - Parse Error: Syntax Error, Unexpected '?' - Notice: Undefined Variable: Submit In

I've made some headway updating old code, but still have 2 problems. Can someone tell me what is wrong with the code lines below? First error: Parse error: syntax error, unexpected '?' ....line xx
line xx: <form action="<?php echo $_SERVER['PHP_SELF']; ?>?p=login" method="post">

Second error: Notice: Undefined variable: submit in .... on line xxx line xxx: <?if ($submit) {$query="SELECT * from members WHERE id = $_GET[id]";.......

View 14 Replies View Related

Enforce Reports Error If Use An Uninitialized/undefined Variable?

I made a huge mistake by mixing result with results and it took me around 4 hours to finally find the bug.So here is the question, in PHP, is it possible that I can enforce PHP to report errors if I use an undefined/uninitialized variable.

View 5 Replies View Related

Get Undefined Variable Error When I Click On A Category On The Index?

I am getting an error in my php coding, Undefined variable .When I click on a category on the index.php, I get the error Notice: Undefined variable: HTTP_GET_VARS in C:wampwwwchapter25show_cat.php on line 6

This is the code for show_cat.php

include ('book_sc_fns.php');[code].....

View 4 Replies View Related

Global Access Of Vars - Error Message - Undefined Variable

I looked into past answers and was led to believe PHP variables assigned in a header file are global. I must be doing something wrong then. Here's a much-simplified version of my code: This is my myGlobals.php file:

$NAMELABEL = "Name";

This is file index.php that 'requires' myGlobals.php then calls a function in a 3rd php file


This is HIGHLY simplified, only the code causing the error. The error msg. I get when I run it is: Notice: Undefined variable: NAMELABEL in C:xampphtdocsfbreverseDisplayRecords.php on line 29 Now, before I changed to the global variable $NAMELABEL -- I used this and it worked fine:.......

View 4 Replies View Related

Error Message: Notice: Undefined Variable: Membership In Line 100

Error Message: Notice: Undefined variable: membership in line 100

PHP Code:

if (isset($_POST['membership'])) {
$membership = implode(', ', $_POST['membership']);
} else {
$error['membership'] = 'Please select all that apply';


My second problem is that if someone dechecks the selections (which shouldn't happen), the correct error is applied, but then I get the "Notice: Undefined variable: membership in line 100" obviously caused by a checkbox option is not set.

How do I set the default checkbox? and how do I prefent the 'Undefined' error if someone decides to decheck the selections?

View 6 Replies View Related

Codeigniter Add Exceptions To Config Class

Maybe, it's a bit silly, but does anybody thought about adding exceptions to Codeigniter Config Class(Library). Not sure, it is(will be) a good practice, but i suppose throwing an exception instead of just returning false is better. For example, if we have something connected with user payments. Usually(?), we'll take some configurable data from codeigniter config files. Imagine, we've done a typical error specifying config index, and CI will return just false, which may cause some logic(!not syntax) error in this software.

View 1 Replies View Related

Write An Array To Config In Codeigniter?

I'm working with a config file that I have create in order to store users. This surely wasn't what the configs were intended to be used for, but it's an extremely small application and I think that it would be a nice solution.

My array looks like this:

$config['users'] = array(array('username' => 'username', 'password' => 'password'));

This works well. I can retrieve the information quick and easy. BUT, if I try to write a new array (a new user) to the config file I get this error:
Illegal offset type in isset or empty

I'm using $this->config->item('users', array('username' =>....)) which doesn't appear to support arrays.

How can I write arrays to my config variable? Is there another way? I was so sure in my head that I could use config->item() that I didn't check the manual for a config->set_item()... BUT, it still doesn't work. Here is the specific code:

$users = $this->config->item('users');
array_push($users, array('username' => $this->input->post('username'), 'password' => $this->input->post('password')));
$this->config->set_item('users', json_encode($users));
echo json_encode($users);

This code is called via Ajax, and I have an alert box to see if it the values are correct. They are. And as you can see, I've tried storing it as json instead of array as well...

View 1 Replies View Related

Codeigniter Access Config.php In Database.php?

At my work we have a typical setupDevelop on localhostTest on stagingLive on productionWe are using codeigniter.Obviously it is a real pain having to change all the settings every time we move them around.What I want to do config.php have $config['env'] = 'localhost'; //'test'; //'production';Then in my database.php and email.php

$env = //config env variable
if($env === 'localhost'){
//localhost settings

View 2 Replies View Related

Build Menu Sing Code - Getting Error Notice: Undefined Variable

I am trying to build a menu sing the code below, I can get the main headings, the problem arises when I try and produce the sub menus. Can someone tell me where I am going wrong, or a better way of getting the desired result


I am getting the following error Notice: Undefined variable: menu_row in /home/sites/ on line 4 The desired result is to produce a menu with the following layout Code: [Select]<div id="accordion">


View 3 Replies View Related

Error While Executing In 5.3.6 "Undefined Variable","Undefined Offset"?

The code that executed in php 5.2.6 is not executing in php 5.3.6.I am getting an error "Undefined variable","Undefined offset".

View 2 Replies View Related

Codeigniter Return Config File As Array With Autoload Enabled?

So I'm using CodeIgniter to build a website and I've made it so that all my specific settings are stored in a config file that's automatically loaded. I've also built a page that loads the settings file, makes a nice little table and allows me to edit everything from that page, afterwards it saves the entire page again (I know I could've done the same with a database but I want to try it this way).

My problem is that I can't seem to use this bit when autoloading of my config file is enabled, but when I disable autoloading I can't seem to manually load it, it never finds my variables. So what I'm doing here is just taking all values from the config file and putting them in a single array so I can pass this array onto my settings administration page (edit/show all settings).

$this->config->load('site_settings', TRUE);
$data['settings'] = $this->config->item('site_settings');
$this->load->view('template', $data);


View 3 Replies View Related

Copyrights 2005-15, All rights reserved