Sunday, 15 February 2015

Include php, css and js files from subdomain -



Include php, css and js files from subdomain -

so need include couple of files subdomain main domain (my subdomain admin.mydomain.com , targets => mydomain.com/admin/), can't to.

my public_html construction is

-admincp (empty, subdomain) -css -js -includes -fonts -images

i need include css, js , php files (which in /includes/) in subdomain index reason retrieves nil using "/css/xxx.css".

i've tried using "/home/user/public_html/includes" (or css, or js) , worked, problem file need include (the header example) this:

<?php session_start(); ?> <!doctype html> <html lang="es-ar"> <head> <meta charset="utf-8" /> <meta name="description" content="<?php echo $meta_description ?>" /> <meta name="author" content="gaspar dip" /> <title><?php echo $page_title ?></title> <link rel="shortcut icon" href="/images/favicon.ico"> <link rel="stylesheet" href="/css/metro-bootstrap.min.css"> <link rel="stylesheet" href="/css/metro-bootstrap-responsive.min.css"> <link rel="stylesheet" href="/css/iconfont.min.css"> </head> <body class="metro"> <nav class="navigation-bar light"> <div class="navigation-bar-content"> <a href="#" class="element"><span class="icon-stats-2"></span> estudio benintendi</a> <span class="element-divider"></span> <a class="pull-menu" href="#"></a> <ul class="element-menu"> <li><a href="/inicio">inicio</a><li> <li><a href="/acercadelestudio">acerca del estudio</a><li> <li><a href="/enviarcurriculum">enviar curriculum</a><li> <li><a href="/contactenos">contactenos</a></li> </ul> <div class="no-tablet-portrait"> <span class="element-divider"></span> <div class="element input-element"> <form> <div class="input-control text"> <input type="text" placeholder="buscar..."> <button class="btn-search"></button> </div> </form> </div> <?php if(!isset($_session["username"])){ ?> <ul class="element-menu place-right"> <li><a href="/login">iniciar sesión</a></li> <li><a href="/registro">registrarse</a></li> </ul> <?php }else{ ?> <div class="element place-right"> <a class="dropdown-toggle" href="#"> <span class="icon-cog"></span> </a> <ul class="dropdown-menu place-right" data-role="dropdown"> <li><a href="#">products</a></li> <li><a href="#">download</a></li> <li><a href="#">support</a></li> <li><a href="/usuarios/logout">salir</a></li> </ul> </div> <span class="element-divider place-right"></span> <button class="element place-right"> <span class="icon-user-3"></span> <?php echo $_session["username"]; ?> </button> <?php } ?> <span class="element-divider place-right"></span> </div> </div> </nav> <div class="container">

so links targetting .css files go admincp.mydomain.com/css/xxx.css instead of mydomain.com/css/xxx.css

did explain myself?

possibly giving absolute path can create difference.

i mean total path css link like

<link rel="stylesheet" href="<?php echo full_path_to_css; ?>/css/xxx.css"/>

include subdomain

No comments:

Post a Comment