Welcome Guest, Not a member yet? Register   Sign In
A question for the pros, to help guide my way....
#3

[eluser]orangeblossom[/eluser]
Yes...no problem. I was thinking there just may be a general solution to check these things by, which is why I put my question in that format. But, thanks for helping & here is the error & code:

The Error:
A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant ‘signup_form’ - assumed '‘signup_form’'

Filename: controllers/login.php

Line Number: 64
An Error Was Encountered

Unable to load the requested file: ‘signup_form’.php

---------------------------------------------------------------------

This is the error line from the login.php (via controller):

$this->load->view(‘signup_form’); (line 64)
-------------------------------------------------------------------------

The login.php (via controller):

Code:
<?php

class Login extends CI_Controller {

function index()
{
  $data['main_content'] = 'login_form';
  $this->load->view('includes/template', $data);  
}

function validate_credentials()
{
  $this->load->model('membership_model');
  $query = $this->membership_model->validate();
  
  if($query) // if the user's credentials validate...
  {
   $data = array(
    'username' => $this->input->post('username'),
    'is_logged_in' => true    
    );
    
    $this->session->set_userdata($data);
    redirect('site/members_area');
  }
  else
  {
   $this->index();
  }
}
function signup()
{
  $data['main_content'] = 'signup_form';
  $this->load->view('includes/template' , $data);
}
function create_member()
{
  $this->load->library('form_validation');
  //field name, error message, validation rules
  
  $this->form_validation->set_rules('first_name' , 'Name' , 'trim|required');
  $this->form_validation->set_rules('last_name' , ' Last Name' , 'trim|required');
  $this->form_validation->set_rules('email_address' , 'Email Address' , 'trim|required|validemail');
  
  $this->form_validation->set_rules('username' , 'Username' , 'trim|required|min_length[4]');
  $this->form_validation->set_rules('password' , 'Password' , 'trim|required|min_length[4]|max_length[32]');
  $this->form_validation->set_rules('password2' , 'Password Confirmation' , 'trim|required|matches[password]');
  
  if($this->form_validation->run() == FALSE)
  {
   $this->signup();
  }
  else
  {
   $this->load->model('membership_model');
   if($query = $this->membership_model->create_member())
   {
    
    $data['main_content'] = 'signup_successful';
    $this->load->view('includes/template' , $data);
}
else
{
$this->load->view(‘signup_form’);
}
}

}

function logout()
{
$this->session->session_destroy();
$this->index();
}

}


------------------------------------------------------------------
The signup_form.php (via views):

Code:
<h1>Create an Account</h1>
<fieldset>
<legend>Personal Information</legend>
&lt;?php

echo form_open('login/create_member');

echo form_input('first_name', set_value('first_name', 'First Name'));
echo form_input('last_name', set_value('last_name', 'Last Name'));
echo form_input('email_address', set_value('email_address', 'Email Address'));
?&gt;
</fieldset>

<fieldset>
<legend>Login Info</legend>
&lt;?php
echo form_input('username', set_value('username', 'Username'));
echo form_input('password', set_value('password', 'Password'));
echo form_input('password2', 'Password Confirm');

echo form_submit('submit', 'Create Account');
?&gt;

&lt;?php echo validation_errors('<p class="error">'); ?&gt;
</fieldset>

------------------------------------------------------------------------------

Just in case: Here is signup_successful.php

Code:
<h1>Congrats</h1>
<p>Your account has been created. &lt;?php echo anchor('Login' , 'Login Now'); ?&gt;</p>

--------------------------------------------------------------------------------

Just in case: login_form.php (from views)

Code:
&lt;style type="text/css"&gt;
#login_form p {
color: #060;
text-align: center;
font-size: 20px;
}
&lt;/style&gt;
<div id="login_form">
  <h1>Page</h1>
    <p>Client Management System</p>
    &lt;?php

echo form_open('login/validate_credentials');
echo form_input('username' , 'Username');
echo form_password('password' , 'Password');
echo form_submit('submit' , 'Login');
echo anchor('login/signup' , 'Not Registered?');
?&gt;
</div>


---------------------------------------

I understand the error (Use of undefined constant ‘signup_form’ - assumed '‘signup_form’')
as if it can't connect, or there is no route to it, or it can't be found, or it doesn't exist.

I'm sure this problem will happen periodically. Therefore, I'm trying to learn steps to rectify this problem. The real lesson is in what to look for. Your stating it might just be quotes.

So:
1) Does the file exist? Yes. It is even directed right.
2) Check the line. Yes. All appears right.
3) Checked the entire code compared to others online. Yes, same.
4) Is it because I have newer CI, that some parts of code is wrong? hmmmmmm.
5) May I be missing a model or controller folder for it? I don't think so.
6) Could it be a quote or something simple? Yes...it happened to me yesterday. Wink


Thank you so much!







Messages In This Thread
A question for the pros, to help guide my way.... - by El Forum - 08-18-2012, 09:01 AM
A question for the pros, to help guide my way.... - by El Forum - 08-18-2012, 09:09 AM
A question for the pros, to help guide my way.... - by El Forum - 08-18-2012, 10:14 AM
A question for the pros, to help guide my way.... - by El Forum - 08-18-2012, 10:31 AM
A question for the pros, to help guide my way.... - by El Forum - 08-18-2012, 10:32 AM
A question for the pros, to help guide my way.... - by El Forum - 08-18-2012, 10:34 AM
A question for the pros, to help guide my way.... - by El Forum - 08-18-2012, 10:39 AM
A question for the pros, to help guide my way.... - by El Forum - 08-18-2012, 11:56 AM
A question for the pros, to help guide my way.... - by El Forum - 08-19-2012, 06:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB