Page 2 of 2 First 12
  • Jump to page:
    #16
  1. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4123
    I'll meet you half way with this

    PHP Code:
    //

    $accept = array(
        
    "ad_suburb"=>true,
        
    "ad_address"=>true,
        
    "ad_da"=>true
    );

    foreach(
    $_POST as $key => $val) {
        if(
    $accept[$key]) {
            $
    $key $this->input->post($key) ? $this->input->post($key) : "";
        }

    but its still not my complete advice
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  2. #17
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2002
    Location
    Seattle, U.S.A.
    Posts
    712
    Rep Power
    13
    As Jacques mentioned smarty can access the post directly.

    Likewise CI 2x can save all the post data to a variable in one go:

    e.g.

    PHP Code:
    // 1st arg means to pass all of the post data, 2nd arg means to do XSS filtering 
    $postData $this->input->post(NULLTRUE); 
    or just


    PHP Code:
    $postData $this->input->post(); 
  4. #18
  5. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,672
    Rep Power
    171
    Thanks for all your posts. The reason I didn't use post directly is the notice:
    A PHP Error was encountered
    Severity: Notice
    Message: Undefined index: ad_address
    Filename: compiled/0622252853eda088aec1d6f87f359808979686e2.file.list_your_place.tpl.cache.php
    Line Number: 82
    But at the end, after reading your responses, it is behaving the way I want it with no problems with:
    Code:
    {if isset($smarty.post.ad_suburb) }{$smarty.post.ad_suburb|htmlentities}
    Any comments?
  6. #19
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Originally Posted by zxcvbnm
    The reason I didn't use post directly is the notice:
    Would have been great if you'd told us that from the beginning. Then we could have focused on the problem instead of your alleged solution.



    Originally Posted by zxcvbnm
    Code:
    {if isset($smarty.post.ad_suburb) }{$smarty.post.ad_suburb|htmlentities}
    Any comments?
    That's how to do it.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo