Welcome Guest, Not a member yet? Register   Sign In
"curl" makes form submission result in 404
#1

[eluser]Bramme[/eluser]
See my last reply please. This is very very weird.

Okay, I'm encountering one of the weirdest bugs I've ever had.

I have a form on a website I made for submitting tutorials. There's a title and short description field, an avatar image file field, a set of radiobuttons for selecting a rank and checkboxes for categories. And a larger textarea where the actual content from the tutorial comes.

When I just put "test" in that last textarea everything gets submitted fine, no problems. However when I enter a large piece of text in the textarea and hit submit, I get my 404 page. The url doesn't change and I have NO idea where the error could be thrown.

I'll try to include some relevant code.

The form:
Code:
<form action="<?php echo base_url(); ?>admin/tutorial/new_tutorial" method="post" enctype="multipart/form-data">
<div class="left">
<p>
    <label for="title">title<br />
    &lt;input type="text" name="title" id="title" value="&lt;?=$this-&gt;validation->title?&gt;" />
    </label>

</p>
<p>
    <label for="content">Description<br />
    &lt;textarea name="content" id="content" style="height: 50px"&gt;&lt;?=$this->validation->content?&gt;&lt;/textarea&gt;
    </label>
</p>
<p>
    <label for="contentHTML">contentHTML<br />
    &lt;textarea name="contentHTML" id="contentHTML" style="height: 500px"&gt;&lt;?=$this->validation->contentHTML?&gt;&lt;/textarea&gt;

    </label>
</p>
</div>
<div class="right">
<p class="lower">
    Thumbnail<br />
    If no thumbnail is selected, the cms will revert to the standard M<br />
    &lt;input type="file" name="imageLoc" id="imageLoc" /&gt;
    
</p>
<p class="lower">
    Select the rank for this tutorial: <br /><br />
    &lt;? foreach($ranks->result_array() as $rank): ?&gt;
    <label for="rank-&lt;?=$rank['rankID']?&gt;">&lt;input type="radio" name="rankID" value="&lt;?=$rank['rankID']?&gt;" id="rank-&lt;?=$rank['rankID']?&gt;" &lt;?php echo $this-&gt;validation->set_radio('rank', $rank['rankID']); ?&gt;/>&nbsp;&nbsp;&lt;?=$rank['name']?&gt;</label><br />
    &lt;? endforeach; ?&gt;
</p>
<p class="lower">
    Select the categories for this tutorial: <br /><br />
    &lt;? foreach($cats->result_array() as $cat): ?&gt;
    <label for="cat-&lt;?=$cat['catID']?&gt;">&lt;input type="checkbox" name="categories[]" value="&lt;?=$cat['catID']?&gt;" id="cat-&lt;?=$cat['catID']?&gt;" &lt;?php echo $this-&gt;validation->set_checkbox_array($cat['catID'], $this->input->post('categories')); ?&gt;/>&nbsp;&nbsp;&lt;?=$cat['name']?&gt;</label><br />
    &lt;? endforeach; ?&gt;
</p>
</div>
<p style="clear: both">
    &lt;input type="submit" name="submNewTutorial" value="Submit" /&gt;
</p>
&lt;/form&gt;

The controller:
Code:
$rules['title']     = 'trim|required|xss_clean';
        $rules['content']     = 'trim|required';
        $rules['contentHTML']     = 'required';
        $rules['rankID']     = 'required';
        $rules['categories[]'] = 'callback_required_checkbox';        
        
        $this->validation->set_rules($rules);
        
        $fields['title']     = 'tutorial title';
        $fields['content']     = 'description';
        $fields['contentHTML']     = 'actual content';
        $fields['rankID']     = 'rank radiobuttions';
        $fields['categories[]'] = 'categories';
        
        $this->validation->set_fields($fields);
        $this->validation->set_error_delimiters('<li>', '</li>');
        
        
        if ($this->validation->run() == TRUE)
        {
            if ( ! $this->backend->add_tutorial())
            {
                send_notice('error', 'Something went wrong with the query', 'self');
            }
            else
            {
                send_notice('success', 'Tutorial successfully added', 'self');
            }
        } else {
            if( ! empty($this->validation->error_string)) {
                send_notice('validation_error', $this->validation->error_string);
            }
        }

The model
Code:
function add_tutorial($edit_id = NULL) {
    // if true = no errors, if false = errors
    $error = TRUE;
    
    $insert['title'] = $this->input->post('title');
    $insert['content'] = $this->input->post('content');
    $insert['contentHTML'] = $this->input->post('contentHTML');
    $insert['rankID'] = $this->input->post('rankID');
    
    //datetime pattern example: 2006-01-03 13:24:10
    $insert['datetime'] = unix_to_human(time(), FALSE, 'eu');
    
    //code to process thumbnails
    
    // depending on wether editting or adding a tut
    if(isset($edit_id)) {
        $this->db->where('tutID', $edit_id);
        if(  ! $this->db->update('tutorial', $insert)) {
            $error = FALSE;
        }
        
    } else {
        if(  ! $this->db->insert('tutorial', $insert)) {
            $error = FALSE;
        }
    }
    
    // code that handles the categories
}

Could this have anything to do with a memory problem? Too much characters in the textarea?[/size]


Messages In This Thread
"curl" makes form submission result in 404 - by El Forum - 09-28-2008, 09:33 AM
"curl" makes form submission result in 404 - by El Forum - 09-28-2008, 12:20 PM
"curl" makes form submission result in 404 - by El Forum - 09-28-2008, 03:11 PM
"curl" makes form submission result in 404 - by El Forum - 09-29-2008, 05:02 AM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 02:39 AM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 03:09 AM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 03:43 AM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 08:55 AM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 09:47 AM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 09:49 AM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 09:51 AM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 12:34 PM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 12:35 PM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 01:47 PM
"curl" makes form submission result in 404 - by El Forum - 10-11-2008, 03:36 PM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 12:44 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 02:21 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 02:42 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 02:46 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 02:53 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 03:00 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 03:15 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 03:37 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 03:38 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 03:45 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 03:52 AM
"curl" makes form submission result in 404 - by El Forum - 10-12-2008, 03:56 AM
"curl" makes form submission result in 404 - by El Forum - 10-16-2008, 12:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB