Ivan Ivković Posted August 30, 2012 Share Posted August 30, 2012 http://pixpresso.mycyberlove.com/ This is the URL. Code in dynamic_src: <?php $p = realpath(dirname(__FILE__)); define('ROOT_SITE_PATH', $p); include(ROOT_SITE_PATH . '/includes/functions.php'); # Global functions. include(ROOT_SITE_PATH. '/includes/init.php'); # Page constants, includes for the app 'n stuff. $init = new Init(); unset($init); if(isset($_GET['file'])){ $file_ext = substr(strrchr($_GET['file'],'.'),1); $file_name = preg_replace('/\.[^.]*$/', '', $_GET['file']); switch(strtolower($file_ext)){ case 'css': header('Content-Type: text/css; charset: UTF-8;'); $file = DIR_STYLES . $file_name . '.php'; if(is_file($file)){ include($file); } break; case 'js': header('Content-Type: application/x-javascript; charset: UTF-8;'); $file = DIR_SCRIPTS . $file_name . '.php'; if(is_file($file)){ include($file); } break; } }else{ die(header('Location: ' . WEB_PATH)); } Code to call it: <script type="text/javascript" src="http://pixpresso.mycyberlove.com/dynamic_src.php?file=nav_scroll.js"></script> <link rel="stylesheet" type="text/css" src="http://pixpresso.mycyberlove.com/dynamic_src.php?file=popups.css"/> Output working! But browser doesn't read it as CSS for some reason? Output in http://pixpresso.mycyberlove.com/dynamic_src.php?file=main.css : body{ margin: 0; text-align: center; overflow-x: hidden; background-color: #f7f7f7; background: url(/src/images/image_background.png); background-repeat: repeat; } *{ font-family: "tahoma",lucida grande,verdana,arial,sans-serif; color: #666; text-shadow: white 0 1px 0; } h4, h5, h6{ font-weight: 300; padding: 0; margin: 0; } img{ border: 0; } .element{ /*background-color: white; border: 1px solid #dadada;*/ /*-moz-box-shadow: 0 0 7px #333; -webkit-box-shadow: 0 0 7px#333; box-shadow: 0 0 7px #333; */ } a{ text-decoration: none; } #background{ position: fixed; top: -50px; left: -50px; width: 150%; height: 150%; background-color: #000; z-index: 99998; display: none; } #background2{ position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #222; z-index: 99980; display: none; } .popup{ position: fixed; left: 50%; top: 50%; background-color: #e5e5e5; z-index: 99999; -moz-box-shadow: 0 0 80px #000; -webkit-box-shadow: 0 0 80px #000; box-shadow: 0 0 80px #333; display: none; border-radius: 4px; } .data{ display: none; } .hidden{ position: absolute; left: -10000px; width: 0; padding: 0; margin: 0; } #warning{ position: relative; top: 90px; border: 1px solid #999; left: 4px; width: 99%; padding: 10px 0px; color: #666; background-color: #e6e6e6; } #warning2{ position: relative; top: 290px; border: 1px solid #555; left: 4px; width: 99%; padding: 10px 0px; color: #444; background-color: #ccc; } #wrapper{ clear: both; width: 98%; position: relative; left: 1%; top: 90px; } .cleaner{ height: 0px; clear: both; } .fl{ float: left; } .fr{ float: right; } .pic_link{ text-transform: none; cursor: pointer !important; } .pointer{ cursor: pointer !important; } .pic_link:hover{ text-transform: none; } img{ border: 0; } .spacer10{ display: block; height: 10px; clear: both; } .spacer20{ display: block; height: 20px; clear: both; } .spacer30{ display: block; height: 30px; clear: both; } .no_decoration{ text-decoration: none !important; cursor: text !important; } .underline{ text-decoration: underline !important; } .image_link{ cursor: pointer; border: 0; } .user_pic{ border: 1px solid #d9d9d9 !important; } So for some reason browser won't render CSS and JS? Why is this the case? Info is being outputted, is something wrong with my html tags or something? Quote Link to comment https://forums.phpfreaks.com/topic/267797-generated-js-and-css-by-php-not-working/ Share on other sites More sharing options...
Ivan Ivković Posted August 30, 2012 Author Share Posted August 30, 2012 It's ok now thanks. Quote Link to comment https://forums.phpfreaks.com/topic/267797-generated-js-and-css-by-php-not-working/#findComment-1373805 Share on other sites More sharing options...
trq Posted August 30, 2012 Share Posted August 30, 2012 Then use the MARK SOLVED button so as to not waste our time. Quote Link to comment https://forums.phpfreaks.com/topic/267797-generated-js-and-css-by-php-not-working/#findComment-1373815 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.