ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to use sub subfolder with Modular Separation ?

May 14, 2010 4:54pm

Subscribe [3]
  • #1 / May 14, 2010 4:54pm

    Kijer

    25 posts

    Hello

    I have a little problem, I just created a form as below but when I “submit”, I have the following error, I do not understand why ...

    Thank you in advance for your help.

    <fieldset>
                            <?php echo form_open('admin/annonces/categories/editer/');?>
                            Nom de la catégorie : <input type="text" id="nom" name="nom" value="<?php echo set_value('nom'); ?>" size="50" /></p>
                            <input type="submit" name="submit" value="Add" />                        
                            <?php echo form_close(); ?>
                        </fieldset>

    he error generated and url ..

    An Error Was Encountered
    The URI you Has Submitted disallowed characters.

    URL -> http://dev.www.example.com/admin/annonces/categories/?nom=&submit=Add

  • #2 / May 14, 2010 5:26pm

    WanWizard

    4475 posts

    CodeIgniter doesn’t use query strings unless you have enabled them, so a URL like that won’t work.

    Change it to something like http://dev.www.example.com/admin/annonces/categories/nom/none/submit/add, and use the URI library to process the URI segments.

  • #3 / May 14, 2010 5:36pm

    Kijer

    25 posts

    CodeIgniter doesn’t use query strings unless you have enabled them, so a URL like that won’t work.

    Change it to something like http://dev.www.example.com/admin/annonces/categories/nom/none/submit/add, and use the URI library to process the URI segments.

    I just do not want the $ _GET parameters, only submit POST.

    I do not want something complicated, just an ordinary form post. (and that data passing through the url).

    A simple form to add, based on my hierarchy admin, possible?

  • #4 / May 14, 2010 5:41pm

    WanWizard

    4475 posts

    If you want to pass variables through the URL, you have to use a URL like in my example, and use the URI library to get the information out. This is how CodeIgniter works.

    I miss the relation between between the URL that you gave, and the form example (which uses a completely different URL).

  • #5 / May 14, 2010 5:51pm

    Kijer

    25 posts

    If you want to pass variables through the URL, you have to use a URL like in my example, and use the URI library to get the information out. This is how CodeIgniter works.

    I miss the relation between between the URL that you gave, and the form example (which uses a completely different URL).

    I’m not sure we speak the same purpose.

    I do not want to pass variables through url. I just want to make a simple standard form to record a new category in my database.

    So I have a form with an input text “name” and a submit button, I confirm that when inserted into the base and I get my news in my controller.

  • #6 / May 14, 2010 6:05pm

    WanWizard

    4475 posts

    Then you should ask the proper question. 😉

    You started this thread with an error message, and I’m responding to that.
    My remark was that in your opening post you define a form with URL ‘admin/annonces/categories/editer/’, which looks ok, and an error message about the URL ‘http://dev.www.example.com/admin/annonces/categories/?nom=&submit=Add’, which is something completely different.

    Looking at the fields in your form example, it looks like a form with a GET method is generated, instead of with a POST method (that would create such a URL).

    Check the HTML of your from, does it say:

    <form method="post" accept-charset="utf-8" action="admin/annonces/categories/editer/" />

    If not, what does it say?

  • #7 / May 14, 2010 6:30pm

    Kijer

    25 posts

    Then you should ask the proper question. 😉

    You started this thread with an error message, and I’m responding to that.
    My remark was that in your opening post you define a form with URL ‘admin/annonces/categories/editer/’, which looks ok, and an error message about the URL ‘http://dev.www.example.com/admin/annonces/categories/?nom=&submit=Add’, which is something completely different.

    Looking at the fields in your form example, it looks like a form with a GET method is generated, instead of with a POST method (that would create such a URL).

    Check the HTML of your from, does it say:

    <form method="post" accept-charset="utf-8" action="admin/annonces/categories/editer/" />

    If not, what does it say?


    sorry if I am not very clear, I am French and it is already a feat to talk to you lol.

    Sometimes a pictures speak louder than words here is my problem.

    So I do not understand why I “http://dev.www.codeigniter.com/admin/annonces/categories/?nom=&submit=Ajouter+la+catégorie” which adds to the url and does not fill in the URL in the action.

    http://www.dailymotion.com/video/xdb4h9_demo2_tech

  • #8 / May 14, 2010 6:41pm

    WanWizard

    4475 posts

    As I said, what is actually defined in the HTML as method and action for the form?

  • #9 / May 14, 2010 6:47pm

    Kijer

    25 posts

    As I said, what is actually defined in the HTML as method and action for the form?

    i’ve “

    form_open('admin/annonces/categories/editer/')
    so
    form_open('folder/folder/controller/function/')

    I just tested my form on the base view (welcome) and it works ..

    As soon as I was testing in my view located in my admin, it makes these weird urls ..

  • #10 / May 15, 2010 12:38pm

    Zack Kitzmiller

    175 posts

    You have $config[‘enable_query_strings’] set to true. All the CI helpers use that variable to decided how to build the forms. Your form_open(); is building the query string.

    set $config[‘enable_query_strings’] to false.

    (Also see ‘Enabling Query Strings’ here: http://ellislab.com/codeigniter/user-guide/general/urls.html)

  • #11 / May 15, 2010 1:42pm

    Kijer

    25 posts

    I just checked and it is false.

    But as I said earlier, if I move my form in the root folder views and I put it into the root file (welcome_view.php), everything works perfectly, the form’s action to send me well to the url specified.

    This is when I moved it to a subfolder under (views / admin / categories / home.php), from there, it does not work anymore .. I have the url that contains query strings, so I do not want .. bug?

    The only change I made from the official version is this file: HERE

    Thank you for your help, I’m stuck ..

  • #12 / May 15, 2010 11:29pm

    pickupman

    1317 posts

    This is when I moved it to a subfolder under (views / admin / categories / home.php), from there, it does not work anymore .. I have the url that contains query strings, so I do not want .. bug?

    Just make sure you are using:

    $this->load->view('admin/categories/home',$data);

    I would probably ditch the code you used from the link you posted. If you are wanting this kind of folder separation, I would recommend this Modular Separation. It was written by two great guys who actively involved in CI’s development.

  • #13 / May 16, 2010 9:23am

    Kijer

    25 posts

    This is when I moved it to a subfolder under (views / admin / categories / home.php), from there, it does not work anymore .. I have the url that contains query strings, so I do not want .. bug?

    Just make sure you are using:

    $this->load->view('admin/categories/home',$data);

    I would probably ditch the code you used from the link you posted. If you are wanting this kind of folder separation, I would recommend this Modular Separation. It was written by two great guys who actively involved in CI’s development.

    Thank you for your answers and your help.

    I quickly looked modular separation, but I can not get it to work correctly, so I need to sub-sub-folder. (Admin / modules / controller).

    So you think that my problem is just above my “MY_router? and that through this modular separation, everything will work properly?

  • #14 / May 16, 2010 9:20pm

    pickupman

    1317 posts

    I probably would. Check out this post about creating an admin panel. Phil mentions using Matchbox in the article, but has since co-coded the Modular Separation linked above. You can see how you can create pseudo subfolders using routes and modules.

  • #15 / May 17, 2010 12:28am

    luzagodom

    1 posts

    Note: This document was written when the main problem was Internet Explorer’s behavior of submitting a form when hitting ENTER in a text input box.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases