www.webdeveloper.com
Results 1 to 3 of 3

Thread: Need help : posting content in sql database using php

  1. #1
    Join Date
    May 2012
    Posts
    2

    Angry Need help : posting content in sql database using php

    I have a form which created in codeigniter framework. I want to post html content into sql database using that form. I am using cleditor editor for text area.
    when i was working in local host, this works fine. but in web server when i post content using this form, sometimes page not found error comes.

    what 's the problem. i am struggling with this problem for the past one week.

    i found the problem is not because of
    1)post_max-size in php.ini
    2)magic_quotes
    3)editor

    what are the other possiblities?
    can any one help me?

  2. #2
    Join Date
    May 2012
    Posts
    37
    Sounds like a path error in your code... can you post the relavent bits?
    "A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
    -- Douglas Adams

    http://www.chaoscontrol.org
    Have you minified your CSS/JS lately?

  3. #3
    Join Date
    May 2012
    Posts
    2

    Angry

    it's not path error..if path error means , it won't work all the time. some times only i get the page not found error.Any way i given the code below..

    Codeigniter model function for this is


    PHP Code:
    $title strip_tags($barray['E_B_title']);
            
    $description strip_tags($barray['E_B_desc'],'<p><a><br><strong><em><li><ul><ol><img><span><font><b><i><u><strike><sup><sub><font><h3><h4><h5><h6><hr><table><tr><td><tbody><tfoot><th><thead>');
            
            
    $url $barray['E_B_url'];
            
    $v_url $barray['E_B_vurl'];
            
            
    $javascript '/<script[^>]*?>.*?<\/script>/si';
            
    $noscript ''
            
    $remove_iframe '/<iframe[^>]*?>.*?<\/iframe>/si';
            
    $remove_xml '/<xml[^>]*?>.*?<\/xml>/si';
            
            
    $description preg_replace($javascript$noscript$description); 
            
    $description preg_replace($remove_iframe$noscript$description);
            
    $description preg_replace($remove_xml$noscript$description);
            
    $description rawurlencode($description);
            
    $tags $barray['E_B_tags'];
            
    $date time();
            
    $E_post_flag $this->session->userdata('Post_flag');
            if(
    $E_post_flag == $barray['E_add_post_flag']) {
                
    $data = array(
                            
    'component' => 'blog',
                            
    'type' => 'posted a blog',
                            
    'title' => $title,
                            
    'description' => $description,
                            
    'u_id' => $uid,
                            
    'date' => $date,
                            
    'c_id' =>$barray['E_B_catg'],
                            
    'no_of_comments' => 0,
                            
    'url' => $url,
                            
    'place_id' => $barray['E_B_place'],
                            
    'v_url' => $v_url,
                            
    'flag' => 's'
                            
    );    
                
    //$query = $this->db->insert('enx_blogs',$data);
                
    $query $this->db->insert('activity',$data); 
    i got description from cleditor editor and then i try insert all into the activity table.some times this works well. but sometimes i got page not found error.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles