Hello, I am new to coding in PHP, and had a question about a simple
thing:
I am trying to echo out the elements of an array for a sidenav in one
of my HTML pages, and I can't seem to figure out the syntax for
appending the element of the array into the path to the file. Here is
the code I have:
<?php
include 'c:\inetpub\web root\sheel\temp late\navbar.htm l';
$fullPath = explode('/', $_SERVER['PHP_SELF']);
echo "The foldername $fullPath[0]";
echo "The filename $fullPath[1]";
echo 'c:\inetpub\web root\sheel\temp late\'.$($fullP ath[1]).".html";
$filename = 'c:\inetpub\web root\sheel\temp late\' .
$fullPath[1].'.html';
$filename2 = 'c:\inetpub\web root\sheel\temp late\' .
$fullPath[1].'.html';
if (file_exists($f ileName)) {
echo "c:\inetpub\web root\sheel\temp late\$fullPath[1].html";
include 'c:\inetpub\web root\sheel\temp late\'.
$fullPath[1].'.html';}
else if (file_exists($f ileName2)) {
echo "c:\inetpub\web root\sheel\temp late\$fullPath[2].html";
include 'c:\inetpub\web root\sheel\temp late\'.
$fullPath[2].'.html';}
else{
echo "<ul id=\"secondaryN av\" ></ul>";}
?>
Thanks for your help!
Sheel
thing:
I am trying to echo out the elements of an array for a sidenav in one
of my HTML pages, and I can't seem to figure out the syntax for
appending the element of the array into the path to the file. Here is
the code I have:
<?php
include 'c:\inetpub\web root\sheel\temp late\navbar.htm l';
$fullPath = explode('/', $_SERVER['PHP_SELF']);
echo "The foldername $fullPath[0]";
echo "The filename $fullPath[1]";
echo 'c:\inetpub\web root\sheel\temp late\'.$($fullP ath[1]).".html";
$filename = 'c:\inetpub\web root\sheel\temp late\' .
$fullPath[1].'.html';
$filename2 = 'c:\inetpub\web root\sheel\temp late\' .
$fullPath[1].'.html';
if (file_exists($f ileName)) {
echo "c:\inetpub\web root\sheel\temp late\$fullPath[1].html";
include 'c:\inetpub\web root\sheel\temp late\'.
$fullPath[1].'.html';}
else if (file_exists($f ileName2)) {
echo "c:\inetpub\web root\sheel\temp late\$fullPath[2].html";
include 'c:\inetpub\web root\sheel\temp late\'.
$fullPath[2].'.html';}
else{
echo "<ul id=\"secondaryN av\" ></ul>";}
?>
Thanks for your help!
Sheel
Comment