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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,636
» Latest member: suge.nagoya
» Forum threads: 65,996
» Forum posts: 414,444

Full Statistics

Latest Threads
Community Auth - a databa...
Forum: Addins
3 hours ago
» Replies: 16   » Views: 578
Last URI segment is zero ...
Forum: General Help
4 hours ago
» Replies: 2   » Views: 46
Community Auth - Database...
Forum: Addins
4 hours ago
» Replies: 5   » Views: 88
modify calendar library
Forum: Libraries & Helpers
9 hours ago
» Replies: 3   » Views: 149
How to handle DB connecti...
Forum: General Help
Today, 05:33 AM
» Replies: 5   » Views: 218
Codeigniter Search and fi...
Forum: General Help
Today, 05:11 AM
» Replies: 4   » Views: 258
New developer to complete...
Forum: Jobs
Today, 04:59 AM
» Replies: 4   » Views: 461
need help about database ...
Forum: General Help
Today, 04:42 AM
» Replies: 2   » Views: 95
How CodeIgniter close db ...
Forum: Libraries & Helpers
Today, 04:12 AM
» Replies: 2   » Views: 207
Codeigniter Website Showi...
Forum: General Help
Today, 02:58 AM
» Replies: 10   » Views: 386

 
  Getting post data from a from...
Posted by: El Forum - 07-11-2007, 12:51 PM - Forum: Archived Development & Programming - Replies (4)

[eluser]kuysal[/eluser]
Hi I'm new to CI and currently on learning level. I'm trying to make a simple login page in which, information is sent by a form with a post method and to be taken as function parameter (This is the only way I know to pass the form elements in CI). Here is the view page I'm using:

Code:
<head>
<title><?=$title?></title>
</head>
<body>
<table width='848' border='0' align='center'>
  <tr>
    <td bgcolor='#E9E9E9'><table width='100%' border='0'>
      <tr>
        <td width='50%' bgcolor='#FFFFFF'><div align='center'><h1>Logo</h1></div></td>
        <td width='50%' bgcolor='#FFFFFF'>
          &lt;? echo form_open('main/login'); ?&gt;
          Username:&lt;input type='text' name='username' id="username" /&gt;
          <br />
          Password:&lt;input type='password' name='password' id="password" /&gt;
          &lt;input type='submit' name='Login' value='Login' /&gt;
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor='#CCCCCC'>&nbsp;</td>
  </tr>
</table>
&lt;/body&gt;
&lt;/html&gt;

and here is my main controller which holds login function:

Code:
&lt;?php

class Main extends Controller {

    function Main()
    {
        parent::Controller();
        
        $this->load->helper('form');
        $this->load->helper('url');
    }
    
    function index()
    {        
        $data['title'] = 'My Blog Title';
        $data['heading'] = 'My Blog Heading';
        
        $this->load->view("main_index_view", $data);
    }
    
    function login($username = 'default', $password = 'default')
    {
        $login_data['title'] = 'Login Page';
        $login_data['username'] = $username;
        $login_data['password'] = $password;
        
        $this->load->view("main_login_view", $login_data);
    }
}
?&gt;

and finally that is my login view:

Code:
&lt;head&gt;
&lt;title&gt;&lt;?=$title?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;? echo 'You are trying to log in with the username : ' . $username;
echo '<br>And password : ' . $password;
?&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;

It always displays the default parameters. Parameters sent by form can't be taken. I've checked the code many times but it still doesn't work. As I've said I'm new to CI.

Please help...


  Language translations help
Posted by: El Forum - 07-11-2007, 12:41 PM - Forum: Archived General Discussion - No Replies

[eluser]Felice Ostuni[/eluser]
Please I need
Hebrew & russian translations, if someone has already used CI with these languages please help.

I know that there is a wiki page with contributed translations, but Hebrew is not there, ans russian link is broken.


respect


  It's possible get the encrypted value using Upload class?
Posted by: El Forum - 07-11-2007, 12:36 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]Unknown[/eluser]
Hi every:
I'm building a application and need some upload stuff. For this I use CI Upload Class but I have some questions about it. First take a look to this code:

Code:
$upload['encrypt_name'] = true;
$this->load->library('upload', $upload);
This generate a encrypted name for uploaded file as doc said. My problem is that with $this->upload->data() can't get this encrypted name for inserted after in the DB. Any knows if this is possible or how to solve this problem?
Cheers


  You must use the SET method to update an entry
Posted by: El Forum - 07-11-2007, 12:23 PM - Forum: Archived General Discussion - Replies (12)

[eluser]plasticated[/eluser]
I am creating a simple form to add data to my database. I have used the code demonstrated in the 20min blog tutorial as a basis. Everything was going great until I wrote the code that inserts the data. For some reason, I am getting an error telling me: 'You must use the SET method to update an entry'.

I have checked and double checked, and it's the same code used in the example. Eg:

Code:
function create_insert()
    {
        $this->db->insert('streams', $_POST);
        redirect('admin/create/');
    }

On the view page I have this:

Code:
&lt;?php echo form_open('admin/create_insert');?&gt;

<p>&lt;input type="text" name"title" /&gt;</p>
<p>&lt;input type="text" name"artist" /&gt;</p>
<p>&lt;input type="text" name"date" /&gt;</p>
<p>&lt;input type="text" name"filename" /&gt;</p>

<p>&lt;input type="submit" value="Create" /&gt;</p>

&lt;/form&gt;

Any ideas? Things were going so well up until this point! Sad


  Calendar Problems, Days Overlapping
Posted by: El Forum - 07-11-2007, 11:05 AM - Forum: Archived Development & Programming - Replies (2)

[eluser]herbageonion[/eluser]
Hi,

I'm trying to get a calendar working for a full year and then highlight the days that have entries in the database.

The problem is, the days keep overlapping into subsequent months. My code is below. Anyone have any suggestions?

Cheers,
- E

Code:
$cal_data    = array();
        
for ( $i=1; $i<13; $i++ )
{
   $like_date = ($i < 10) ? $seg_3.'-0'.$i : $seg_3 .'-'. $i;
   // Query DB
   $query    = $this->db->query("SELECT * FROM `tbl_courses` WHERE FromDate LIKE '%$like_date%'");
  
   foreach ($query->result() as $row)
   {
      $cal_day           = mdate_to_human($row->FromDate, 'd');
      $year              = mdate_to_human($row->FromDate, 'Y');
      $month             = mdate_to_human($row->FromDate, 'm');
      $day               = mdate_to_human($row->FromDate, 'd');
      $cal_data[$cal_day]= $this->config->item('site_url') .'coursedesc/index/'. $year .'/'. $month .'/'. $day.'/';
   }
   $data['calendar'][$i] = $this->calendar->generate($seg_3, $i, $cal_data);
}


  Headaing...utf8?sessions?
Posted by: El Forum - 07-11-2007, 11:01 AM - Forum: Archived Development & Programming - Replies (2)

[eluser]whidbey[/eluser]
I found it not easy to do with sessions and utf-8
my control folder with utf-8 style files.

my autoload.php use:
$autoload['libraries'] = array('database','session');
using system's session libary,
my page got error like this:

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at F:\Myshop\51szu\system\application\config\config.php:1)

Filename: libraries/Session.php

Line Number: 282


using obsession to my own libary folder.
I got errors like this:

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at F:\Myshop\51szu\system\application\config\config.php:1)

Filename: libraries/Session.php

Line Number: 452
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at F:\Myshop\51szu\system\application\config\config.php:1)

Filename: libraries/Session.php

Line Number: 493


  URL Manipulation
Posted by: El Forum - 07-11-2007, 09:38 AM - Forum: Archived Development & Programming - Replies (4)

[eluser]BrandonDurham[/eluser]
So is it possible for me to make a url that looks like this:

Code:
http://www.site.com/index.php/admin/view/entryname

look like this:
Code:
http://www.site.com/entryname

If so, how do I go about that?

Thank you.


  for upload pictures' class
Posted by: El Forum - 07-11-2007, 09:03 AM - Forum: Archived General Discussion - Replies (2)

[eluser]Lonely Angel[/eluser]
who can to give me a CI's class for upload pictures ... thanks


  session problem
Posted by: El Forum - 07-11-2007, 09:01 AM - Forum: Archived General Discussion - Replies (9)

[eluser]magicbug[/eluser]
Hi All,

Im new to the whole CI thing and having a problem with session which i cant work out! I put

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

Inside my controller index but when i visit the controller /name/ in a web browser i get the following errors

Code:
A PHP Error was encountered

Severity: Warning

Message: serialize() [function.serialize]: Node no longer exists

Filename: libraries/Session.php

Line Number: 268

Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /data/www/whatsmylocator.co.uk/beta/system/libraries/Exceptions.php:164)

Filename: libraries/Session.php

Line Number: 282

I cant seem to work out why this is actually happening!

Cheers Peter


  Page logic
Posted by: El Forum - 07-11-2007, 08:42 AM - Forum: Archived Development & Programming - Replies (1)

[eluser]magicPants[/eluser]
Hi,

I'm trying to design/build a timesheet application using CI (I'm a newbie to CI) and have broken the classes down into the following: project, task, activity & resource. The concept is: an activity will record the time spent on a certain task for a project.

In order to view the list of activities for a project/task I would like to do something like:

List all activities for task 'x' under project 'y':
/timesheet/index.php/activity/projectY/taskX/

or

List all activities for project 'y':
/timesheet/index.php/activity/projectY/

What's the nest way to achieve this within my activity class?

TIA

Dave



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