Associate
- Joined
- 11 Oct 2008
- Posts
- 268
I have a div on my site that is hidden on desktop then comes visable on mobile devices. Ideally I want to use the following code to include my content in both my normal content div, and my mobile div, and just have one showing at a time.
If I try to use it twice in my index.php page, the include default works but when I try to access a page it halts any content from loading.
Is there a way I can use this code twice in one page?
Thanks
If I try to use it twice in my index.php page, the include default works but when I try to access a page it halts any content from loading.
Is there a way I can use this code twice in one page?
PHP:
<?php
if (isset($_GET['nav']))
{
if (strpos($_GET['nav'], "/"))
{
$direc = substr(str_replace('..', '', $_GET['nav']), 0, strpos($_GET['nav'], "/")) . "/";
$file = substr(strrchr($_GET['nav'], "/"), 1);
if (file_exists($direc.$file.".php"))
{
include($direc.$file.".php");
} else {
include("error.php");
}
} else {
if (file_exists(basename($_GET['nav']).".php"))
{
include(basename($_GET['nav']).".php");
} else {
include("error.php");
}
}
} else {
include("default.php");
}
?>
Thanks