Reputation: 5564
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.
Upvotes: 0
Views: 136
Reputation: 23896
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.
Upvotes: 1
Reputation: 17974
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');
}
}
?>
Upvotes: 1
Reputation: 18588
If your code sample is from the start of your file the problem is you dont have any opening PHP tags e.g. <?php
Upvotes: 1