Use this exact same template on other pages of my website, and I’m trying to include some CSS in my beginning.php if a $_GET[‘demos’] is set.
[14-Jan-2015 15:42:49 America/Denver] PHP Warning: require_once(/home1/codefund/public_html/../includes-test/beginning.php?demos=valr): failed to open stream: No such file or directory in
/home1/codefund/public_html/demos-test/vertical-align-left-right.php on line 3
[14-Jan-2015 15:42:49 America/Denver] PHP Fatal error: require_once(): Failed opening required '/home1/codefund/public_html/../includes-test/beginning.php?demos=valr' (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /home1/codefund/public_html/demos-test/vertical-align-left-right.php on line 3
This is my beginning.php
<?php
error_reporting(E_ALL); ini_set('display_errors', 'On');
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php echo $page;?> - CodeFundamentals</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<meta name="Description" content="CodeFundamentals offers a wide range of useful articles aimed at web designers. The articles cover a wide berth of topics in CSS and HTML. We also are available for web design services and offer competitive prices. Come check us out today and get your free quote!">
<meta name="Keywords" content="CSS, HTML, web, SEO, Accessibility, blog, portfolio, web designer, hire, articles, links, demos">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link href="http://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Roboto|Roboto+Condensed" rel="stylesheet" type="text/css">
<link href="/scripts/resets.css" type="text/css" rel="stylesheet">
<link href="/scripts/styles.css" type="text/css" rel="stylesheet">
<link href="/scripts/code-script.css" type="text/css" rel="stylesheet">
<style type="text/css">
@import url(http://www.google.com/cse/api/branding.css);
</style>
<?php
if(isset($_GET['demos']))
{
if($_GET['demos']==="valr")
{
echo '<style type="text/css">
.block
{
overflow:hidden;
text-align:justify;
/* IE special */
width: 100%;
-ms-text-justify: distribute-all-lines;
text-justify: distribute-all-lines;
}
.block:after
{
content: " ";
display: inline-block;
width: 100%;
height: 0;
font-size:0;
line-height:0;
}
.div_location_description
{
display:inline-block;
}
.div_address
{
display:inline-block;
vertical-align: baseline;
}
</style>';
}
}
?>
</head>
<body>
This is my page that fails. Only difference that makes this fial is line 3. Dunno why though.
<?php
$page="Template";
require_once($_SERVER['DOCUMENT_ROOT'].'/../includes-test/beginning.php?demos=valr');echo "\n";
require_once($_SERVER['DOCUMENT_ROOT'].'/../includes-test/header.php');echo "\n";
require_once($_SERVER['DOCUMENT_ROOT'].'/../includes-test/nav.php');echo "\n";?>
<div class="main-wrap">
<div class="main">
<div class="content">
<div class="container">
<div class="block">
<div class="div_location_description">Room ABC</div>
<div class="div_address">
<div>Sample Address</div>
<div>123 Main St</div>
<div>Anywhere, NY 12345</div>
</div>
</div>
</div>
</div>
<?php require_once($_SERVER['DOCUMENT_ROOT'].'/../includes-test/sidebar.php');echo "\n";?>
</div>
</div>
<?php require_once($_SERVER['DOCUMENT_ROOT'].'/../includes-test/footer.php');echo "\n";?>