2015-01-08, 00:00:54
hook_common
look at the hook list in the wiki, also my dev plugin helps you see the hooks and timing of them.
you need to use a hook that occurs before headers are sent of before the page starts to output.
you do not need to call it via {}, it will be called automatically when the common hook is called.
It is also possible that you have a file outputting whitespace and not actual headers. whitespace before or after a php tag in a file will do this.
index-pretemplate is probably better
not sure exactly what you are trying to accomplish, but this seems the wrong way to do this, and very unsafe.
you should also create a new thread for what you are trying to do.
look at the hook list in the wiki, also my dev plugin helps you see the hooks and timing of them.
you need to use a hook that occurs before headers are sent of before the page starts to output.
you do not need to call it via {}, it will be called automatically when the common hook is called.
It is also possible that you have a file outputting whitespace and not actual headers. whitespace before or after a php tag in a file will do this.
index-pretemplate is probably better
PHP Code:
<?php
// hook index-pretemplate
global $url;
if($url == 'myslug' && isset($_GET['myfile'])){
$myfile = $_GET['myfile'];
// sanitize the shit out of user input!
$path = 'data/uploads/';
header('location: ' .$path.$myfile);
}
?>
not sure exactly what you are trying to accomplish, but this seems the wrong way to do this, and very unsafe.
you should also create a new thread for what you are trying to do.