Why do i get an error when i try and use a variable in this function?
<?php REQUIRE_ONCE('file.php?variable=1'); ?>
any pointers as to how i could pass a variable to an require file?
Because it doesn't find that file. You instead need to do this
<?php $variable=1; require_once("file.php"); ?>
If you're specifying $GET explicitly on that page, try instead
<?php $_GET['variable']=1; require_once("file.php"); ?>