views:

52

answers:

3

can anybody explain why uploaded php files treated by a server as a text file ?

The symptom is when i try to access a php file, the server send me the content of the file.

i have edited and put part of content as asked. This is output i see in the browser

*** WHAT : Removinng Meta Box in Post using $pageshow thing WHY :*****************************************/function bk_cdp_meta_box($pageshow) { switch ($pageshow) { case 'postnew.php' : add_action('dbx_post_advanced', 'bk_cdp_meta_box_reindex'); break; case 'pagenew.php' : add_action('page_advanced', 'bk_cdp_meta_box_reindex'); break; default : } if ($pageshow != "") {// remove_meta_box('postcustom', 'post', 'normal');// remove_meta_box('postexcerpt', 'post', 'normal');// remove_meta_box('trackbacks', 'post', 'normal'); }}/**************************************** WHAT : Reindex List all of Post panel Metaboxes before get remove or add a new meta_box WHY : FIXME : TODO : RETURN : ARGs :***

i download what i have upload and every one of them has <?php as i code it before, so the source of problem exist somewhere else.

+1  A: 

If your code sample is from the start of your file the problem is you dont have any opening PHP tags e.g. <?php

seengee
+1  A: 

you are missing the php open tags and the comment tags are wrong. Try this:

    <?php
    function bk_cdp_meta_box($pageshow) { 
           switch ($pageshow) { 
              case 'postnew.php' : 
              add_action('dbx_post_advanced', 'bk_cdp_meta_box_reindex'); 
              break; 

              case 'pagenew.php' : 
              add_action('page_advanced', 'bk_cdp_meta_box_reindex'); 
              break; 

              default : 
           } 
       if ($pageshow != "") {
      // remove_meta_box('postcustom', 'post', 'normal');
      // remove_meta_box('postexcerpt', 'post', 'normal');
      // remove_meta_box('trackbacks', 'post', 'normal'); 
     }
}

?>
pixeline
@pixeline, the problem in not on that part.
justjoe
+1  A: 

This might happen if your new uploaded files doesn't get executable attribute and the server is configured to prevent execution of such files. I've never seen such a thing though.

Basilevs