0

I'm trying to output my screen.css file contents with in <style> tag.

I thought this was the easy part, but relative path not working?

See my code...

<?php printf('<style type="text/css">%s</style>', file_get_contents('css/screen.css?v='.rand()) ); ?> 

So in theory, this code is in my index.php, the relative path should find the css folder local to my php file? But I get this error...

Warning: file_get_contents(./css/screen.css?v=1836240868): failed to open stream: No such file or directory in index.php on line 18
');

See my folder my structure below...

enter image description here

If anyone can give me some advice or help on this that would be great.

Zoe
  • 27,060
  • 21
  • 118
  • 148
joshmoto
  • 1,650
  • 2
  • 14
  • 21

1 Answers1

0

Php code



define("BASE_URI", "http://example.com/");




Html code


    <link href="<?php echo BASE_URI;?>/folder/style.css" rel="stylesheet" />


dılo sürücü
  • 3,821
  • 1
  • 26
  • 28