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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 11,095
» Latest member: Carmen Follansbee
» Forum threads: 67,623
» Forum posts: 422,770

Full Statistics

Latest Threads
Unable to locate the spec...
Forum: General Help
45 minutes ago
» Replies: 9   » Views: 182
global_xss_clean
Forum: Installation & Setup
2 hours ago
» Replies: 0   » Views: 10
Cannot Pass More than two...
Forum: Model-View-Controller
3 hours ago
» Replies: 7   » Views: 149
Lost session
Forum: CodeIgniter 4 Support
5 hours ago
» Replies: 16   » Views: 294
ci-phpunit-test for CodeI...
Forum: Addins
Yesterday, 06:42 AM
» Replies: 87   » Views: 55,297
custom helper function
Forum: Model-View-Controller
Yesterday, 06:27 AM
» Replies: 4   » Views: 157
Share PHP Sessions across...
Forum: General Help
Yesterday, 05:29 AM
» Replies: 1   » Views: 61
can't get link to work
Forum: General Help
Yesterday, 05:27 AM
» Replies: 35   » Views: 13,990
Validation error messages...
Forum: General Help
Yesterday, 05:13 AM
» Replies: 2   » Views: 62
Security with CI
Forum: Best Practices
Yesterday, 05:11 AM
» Replies: 5   » Views: 560

 
  use of shorthand php tag in CodeIgniter_1.5.4/user_guide/general/views.html
Posted by: El Forum - 09-14-2007, 05:01 PM - Forum: Archived Development & Programming - Replies (6)

[eluser]Unknown[/eluser]
The looping example in CodeIgniter_1.5.4/user_guide/general/views.html uses shorthand tags:

Code:
<?=$item;?> instead of full tags: <?php echo $item; ?>

The acceptance of shorthand tags is a PHP configuration option. On my server it is turned off, so the shorthand tag code above did not work. I suggest either mentioning this in views.html or changing the example to use full PHP tags. My preference is to use full tags throughout. Shorthand tags only save a tiny bit of typing, and using an editor like vim you can easily reduce typing further by using the macro facility. Full tags make it easy to see that you are shifting contexts from html to PHP.


  No validation errors is shown online!
Posted by: El Forum - 09-14-2007, 04:54 PM - Forum: Archived Development & Programming - Replies (4)

[eluser]kruse[/eluser]
Hello,

This is a function to create a new user. It works perfectly fine offline on PHP5
but online on my server PHP4 it does not display validation errors on the form!

What can be wrong? I searched for hours : ) Please check the code.

Code:
function do_signup()
    
    {
        
        ///////////////////////////////////////////////////////////
        //
        //  Get the language from the settings
        //
        ///////////////////////////////////////////////////////////

        $language = $this->config->item('site_language');
        
        ///////////////////////////////////////////////////////////
        //
        //  Load the language files
        //
        ///////////////////////////////////////////////////////////

        $this->lang->load('signup', $language);
        
        ///////////////////////////////////////////////////////////
        //
        //  Load the validation library
        //
        ///////////////////////////////////////////////////////////

        $this->load->library('validation');

        ///////////////////////////////////////////////////////////
        //
        //  Validate the input
        //
        ///////////////////////////////////////////////////////////
        
        $rules['forname']        = "required|min_length[2]";
        $rules['lastname']        = "required|min_length[2]";
        $rules['email']            = "required|valid_email";
        $rules['username']        = "required|callback_username_check";
        $rules['password']        = "required|min_length[5]";
    
        $this->validation->set_rules($rules);

        ///////////////////////////////////////////////////////////
        //
        //  Set the validation items
        //
        ///////////////////////////////////////////////////////////

        $fields['forname']            = $this->lang->line('signup_forname');
        $fields['lastname']            = $this->lang->line('signup_lastname');
        $fields['email']            = $this->lang->line('signup_email');
        $fields['username']            = $this->lang->line('signup_username');
        $fields['password']            = $this->lang->line('signup_password');
        
        $this->validation->set_fields($fields);
        $this->validation->set_error_delimiters('<div class="field_error">', '</div>');

        ///////////////////////////////////////////////////////////
        //
        //  Process the incoming fields
        //
        ///////////////////////////////////////////////////////////

        if ($this->validation->run() == FALSE)

        {

        ///////////////////////////////////////////////////////////
        //
        //  Get the language from the settings
        //
        ///////////////////////////////////////////////////////////

        $language = $this->config->item('site_language');
        
        ///////////////////////////////////////////////////////////
        //
        //  Load the language file
        //
        ///////////////////////////////////////////////////////////

        $this->lang->load('navigation', $language);      
        $this->lang->load('signup', $language);
        
        ///////////////////////////////////////////////////////////
        //
        //  Display the errors
        //
        ///////////////////////////////////////////////////////////
    
        $this->load->view('signup');

        } else {

        ///////////////////////////////////////////////////////////
        //
        //  Put the incoming date in variables
        //
        ///////////////////////////////////////////////////////////

        $pass = $_POST['password'];
        $pass = dohash($pass,'md5');
            
        $data = array(
                           'forname'             => $_POST['forname'] ,
                           'lastname'             => $_POST['lastname'] ,
                           'email'             => $_POST['email'] ,
                           'username'             => $_POST['username'] ,
                           'password'             => $pass ,
                           'points'             => 0 ,
                           'status'             => 1
                );

    
        ///////////////////////////////////////////////////////////
        //
        //  Save the new post
        //
        ///////////////////////////////////////////////////////////
    
        $this->db->insert('profiles', $data);

        ///////////////////////////////////////////////////////////
        //
        //  Redirect to previous page
        //
        ///////////////////////////////////////////////////////////
        
        
        redirect('login/form');
        


        }

    
    }


  "wrap it up" silly question
Posted by: El Forum - 09-14-2007, 03:41 PM - Forum: Archived General Discussion - Replies (5)

[eluser]belial[/eluser]
Today i ran into codeigniter. I must say i am loving the ideea of programming in such a flexible yet dinamic way. My knowledge of php is at a medium level, however i was reading the userguide (not finished it, but will be) and asked myself the question: "ok, let's say i've done a cute little site and now want to "extract" it from the codeigniter folder; how can i do that ?".
I'm using wamp on my localhost and so far i'm very into this. I'd like to know how am i going to "take" my "site files" out of CodeIgniter dir and run them on another host ?


  learning codeigniter - Fatal error: Class blog: Cannot inherit from undefined class controller
Posted by: El Forum - 09-14-2007, 03:09 PM - Forum: Archived General Discussion - Replies (3)

[eluser]Unknown[/eluser]
Hi,

I am new to codeigniter, i am getting this error to run simple codeigniter example.

Fatal error: Class blog: Cannot inherit from undefined class controller in C:\ns\www\ci\system\application\controllers\blog.php on line 2

right now I just want to use blog.php class
&lt;?php
class Blog extends Controller {
function index()
{
echo 'Hello World!';
}
}
?&gt;
and i have index.php file
&lt;? require("../system/application/controllers/blog.php"); ?&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;

I will be thankful if someone help me.

Thanks

HF


  Php file run in background...
Posted by: El Forum - 09-14-2007, 12:17 PM - Forum: Archived Development & Programming - Replies (10)

[eluser]kuysal[/eluser]
Hi;

I have an application which simply gets an rss content and inserts to database. This process must be done periodically every 10 minutes. But I have a shared hosting account and I'm not allowed to run a php file on the server as usual. Is there another way to do this?

Thanks...


  Controller Subfolder or Custom Routes?
Posted by: El Forum - 09-14-2007, 10:33 AM - Forum: Archived Development & Programming - Replies (4)

[eluser]K-Fella[/eluser]
If I wanted to use http://www.domain.com/admin/users/edit/user_id would I need to use Controller subfolders or custom routes?


  he best structure for a site with admin area
Posted by: El Forum - 09-14-2007, 09:23 AM - Forum: Archived Development & Programming - Replies (13)

[eluser]artificialkid[/eluser]
Hy, I already post this question , But I´m still without a good awnser.

What do you guys think is the best file structure with CI for a site with adm area, should i have 2 system folders, I would like to separate things the public site from d adm.

tnaks


  default controller
Posted by: El Forum - 09-14-2007, 09:11 AM - Forum: Archived Development & Programming - Replies (2)

[eluser]Unknown[/eluser]
We're getting ready to launch our site, however we've recently come across an issue where it seems as if the default controller doesn't always load or it is not always found. When the happens we end of with a 404 error.

Has anyone else experienced this same issue? Has anyone been able to resolve this?


  Encoding a password
Posted by: El Forum - 09-14-2007, 08:27 AM - Forum: Archived General Discussion - Replies (11)

[eluser]Kemik[/eluser]
Hello,

I'm trying to use CI's $this->encrypt->encode() function to encode the users password and check it against the one in the database so they can login.

However, if I encode "test" the result changes every time. E.g. "test could = dfs77fdshdsfdfs= but then DSUDSDSDhds= next time (I just typed random characters there btw).

They always seem to have an = at the end of the string though.

What's the best way to encode a password and keep the string the same every time?

Edit. I've done some tests...

Password: test1
Password Hash: EhfaYeOPfM/rtDvbrJh/EecblQSrVtDfP6x/Lg8toug=
Decoded: test1

Password: test1
Password Hash: /HFJAzH04ublyUWzMgwhlLv/Q1SPEfpQ3QaCX0eDpOE=
Decoded: test1

There's just two examples.


  Implementing some code
Posted by: El Forum - 09-14-2007, 08:09 AM - Forum: Archived Development & Programming - Replies (12)

[eluser]manilodisan[/eluser]
I'm trying to implement what seems to be a very good class but I'm having big troubles. The code is supposed to help me cache the pages better and have some sort of a better control over the headers and stuff. The problem is that I have to use the code right after an ob_start() which should sit after the opening php tag and call the class right before the closing php tag. This would have been very simple on a regular php file but, as you can surely imagine, it's a little complicated with our controllers and views.

Here's a sample usage of the code:

Code:
&lt;?php
//------------Start of file---------------

ob_start();            // <==== line 1
include('Conteg.inc'); // <==== line 2

//the page ...

new Conteg();          // <==== line 3
//-------------End of file----------------
?&gt;

Also, here's a link to the original package (it's on phpclasses.org you will need some sort of credentials), PLUS the original support page for this class with more details.


I would really appreciate your help.

Thank you.



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