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.

sometime form content is not posted instead it shows page not found error

April 28, 2008 8:55am

Subscribe [2]
  • #1 / Apr 28, 2008 8:55am

    arian1

    18 posts

    Hi everyone,
    I made simple web application where i can simply update content using FCKEDITOR
    everything works fine but sometime the content doesn’t get submitted instead the page shows error : ” page not found ” .. post_max_size in php.ini is 25 mb so i guess that is not the problem .. also i tried posting data without FCKEDITOR but the problem is still there..
    i was just wondering why some data i can update without any problem but others show error
    “page not found ” .. if anyone know the reason why it’s happening please reply soon.

    thanks

  • #2 / Apr 28, 2008 8:57am

    xwero

    4145 posts

    is the link you use for the form action attribute a valid link?

  • #3 / Apr 28, 2008 2:03pm

    arian1

    18 posts

    form action=”<?=base_url();?>admin/edit_content/<?=this->uri->segment(3)?>”
    base_url() is defined in codeiginter config file.
    admin is controller name and edit_content is updating funtion inside admin controller.
    i think link is not the problem because i can update other content only when i try to update some content it shows the error message.

    Not Found
    The requested URL /admin/edit_content/25 was not found on this server.

    Apache/1.3.41 Server at http://www.sitename.com Port 80

  • #4 / Apr 29, 2008 9:12am

    arian1

    18 posts

    hope someone can tell me why i am getting that error .
    thanks

  • #5 / May 09, 2008 2:58pm

    arian1

    18 posts

    Hi everyone ...
    still waiting ..
    hope someone can help
    Thanks

  • #6 / May 09, 2008 3:38pm

    garymardell

    315 posts

    Well if u copied and pasted that code

    m action=”<?=base_url();?>admin/edit_content/<?=this-<uri-<segment(3)?>”

    it should be

    action="<?=base_url();?>admin/edit_content/<?=this->uri->segment(3);?>

    Your arrows (<) are back to front and should be (>)

  • #7 / May 09, 2008 3:56pm

    arian1

    18 posts

    actually i tried posting data with simple form .
    it works perfectly fine but sometime data is not posted instead the error message comes in next page
    saying Page not found on this server .
    it happens only when i copy and post some specific data..
    i tried posting same data in other server and it got posted .
    i guess something is wrong with my current server ..
    if you have any idea why it’s happening please write back
    thanks a lot to everyone who replies.

  • #8 / May 09, 2008 5:30pm

    arian1

    18 posts

    Ok…after some more testing now i have a string which i cannot post string = “union select”
    when i write that string in my textarea and post it shows error

    Not Found
    The requested URL /test.php was not found on this server.

    Apache/1.3.41 Server at http://www.sitename.com Port 80

    when i tried posting same string on another server it worked fine so i guess this problem is related with

    server ... please please if anyone has any idea what is going wrong please reply…

    thank

  • #9 / May 09, 2008 7:24pm

    gtech

    824 posts

    could you copy your form and the controller you are submitting to?

    I know I use site_url() not base_url() in my links as if you do not have a htaccess file then the index.php needs to be in the link

    eg

    action="<?=site_url();?>/admin/edit_content/<?=this->uri->segment(3);?>

    what I dont get is why your passing a parameter through the url when you are posting data.. or have I missed a trick here?

  • #10 / May 09, 2008 8:22pm

    arian1

    18 posts

    actually i think the problem is not with form action ..
    i tried posting data with simple form outside of codeigniter and also making my .htaccess file empty.
    form example below:
    <?php
    if(isset($_POST[‘submit’])){
    echo $_POST['content'];
    }
    ?>
    <form method=“post” >
    <textarea cols=“100” rows=“50” name=“content” ></textarea>
    <input type=“submit” name=“sbumit” value=“submit” >
    </form>

    as i mentioned before i can post any data using above code and i can see through php the posted data.
    that means above form is working fine but when i try to post data wich content string “union select
    it doesn’t get posted instead it shows error message

    Not Found
    The requested URL /test.php was not found on this server.

    Apache/1.3.41 Server at http://www.sitename.com Port 80


    i used the above simple form to post string “union select” on another server and the data got posted without any error message .. so i think something is wrong with my current server..which is not letting me post a simple html form if the textarea content string : “union select” ..
    so in simple words i cannot post if my form content string “union select

    Server type:linux
    anyone any idea why it’s happening
    please reply
    thanks

  • #11 / May 09, 2008 9:16pm

    arian1

    18 posts

    hmmm….
    i think something is wrong with post and “union select”
    i tried to go to the link on browser address bar : http://www.sitename.com/test.php?content=“union select”
    and it showed error message


    Not Found
    The requested URL /test.php was not found on this server.

    Apache/1.3.41 Server at http://www.mysite.com Port 80

    and if i remove go to link like : http://www.sitename.com/test.php?content=“unio select”
    notice n is not there in union ..

    and i can see the page without any error

    hope someone knows why it’s happening
    thanks

  • #12 / May 09, 2008 9:32pm

    gtech

    824 posts

    [edit]
    why are you posting values through the URL?
    [/edit]

    the whole point of using post is that the variables are not transmitted through the URL but through post data, which can be retrieved on the receiving controller.

  • #13 / May 09, 2008 10:08pm

    gtech

    824 posts

    <?php
    class Test extends Controller   {
      function Test(){
        parent::Controller();
      }
      function postto() {
        // this function is called once the form has been submitted.
        $content = $this->input->post('content');
        echo $content;
      }
      function testform() {
        // call this function from the browser and the form will be displayed
        echo '<form method="post" action="'.site_url().'/test">';
        echo '<textarea cols="100" rows="50" name="content"></textarea>';
        echo '<input type="submit" name="sbumit" value="submit" >';
        echo '</form>';
      }
    }
    ?>

    I maybe misunderstanding what you are trying to do, and I have no knowledge of your coding experience.. so I have knocked up a test controller (note I am only echoing content so you can cut and paste the controller and tryit out for yourself).

    if you browse to
    http:<site>/<ci install>/index.php/test/testform/

    you can test the form and try posting the data you are failing.. the form will post to the index function where it will just simply display the content you have posted.

    its never a good idea to submit text area data through the URL.

  • #14 / May 09, 2008 11:04pm

    arian1

    18 posts

    thanks a lot for replying ....
    and i am just a beginner coding vise…
    but i think here code is not the problem
    the reason i was passing value through url to test what happens when
    string “union select” is passed as value through url…
    and believe me when i do that the result comes page not found which is not correct result
    test.php is my testing file name which is on my root folder
    so everything is ok with codeigniter ... and the problem is with string “UNION SELECT” i think the server i am using is filtering all post data and if posting data contents
    string “union select” than it doesn’t get posted instead it show page not found error
    i never had this problem before on other servers this is the first time i am seeing something like this
    ... i know it’s not related to codeigniter but if anyone has any idea or knows what going wrong please reply
    thanks to all

  • #15 / May 10, 2008 6:28am

    garymardell

    315 posts

    <input type=“submit” name=“sbumit” value=“submit” >

    You have typos everywere… you have the name as sbumit not submit so it will have failed aswell.

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

ExpressionEngine News!

#eecms, #events, #releases