Sebastian Breit
Sebastian Breit

Reputation: 6159

Codeigniter: "The URI you submitted has disallowed characters" when submitting a form

So I have a simple form with some inputs in my codeigniter project:

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
        <input type="hidden" name="new_project" value="true"/>
        <input type="text" placeholder="Nombre" name="nombre"/><br/>
        <input type="text" placeholder="Cliente" name="cliente"/><br/>
        <input type="submit" value="crear"/>
</form>

When I submit the form, I get the following message:

An Error Was Encountered
The URI you submitted has disallowed characters.

and in the address bar of my browser, the following appears:

http://mycodeigniterproject/index.php/projects/manage%20%3E%3Cinput%20type=

I already tried modifying this in my config.php file:

$config['permitted_uri_chars'] = '+=a-z 0-9?~%.,:_\-';

and

$config['enable_query_strings'] = TRUE;

Thanks for your attention

Upvotes: 2

Views: 5195

Answers (1)

Sebastian Breit
Sebastian Breit

Reputation: 6159

So I feel pretty stupid now. I was trying to submit a file without the multipart :S

here is the corrected code:

<?php echo form_open_multipart('projects/manage?pid='.$project->id);?>
    <input type="file" name="userfile"/><br/>
    <input type="submit" value="crear"/>
</form>

Upvotes: 2

Related Questions