Jump to content

Undefined index


Recommended Posts

OK im getting an undefined index in this code

Notice: Undefined index: page in *FilePath*/index.php  on line 5

 

<?php

include('functions.php');

$nav = $_GET['page'];
secure($nav);

$siteurl = 'http://localhost:8888/healthycpus';

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Home Page</title>
<link rel="stylesheet" type="text/css" href="healthy.css" />
<script type="text/javascript">
// Copyright 2006-2007 javascript-array.com

var timeout	= 250;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
// cancel close timer
mcancelclosetime();

// close old layer
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

// get new layer and show it
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
if(closetimer)
{
	window.clearTimeout(closetimer);
	closetimer = null;
}
}

// close layer when click-out
document.onclick = mclose; 
</script>
</head>

<body>
<div class="wrapper">
<div class="header">
    	
        <img src="images/header.png" />
        
    </div>
    <div class="navbar">
    
    <ul id="sddm">
    	<li><a href="<?=$siteurl?>">Home</a></li>
        <li><a href="#" 
            onmouseover="mopen('m1')" 
            onmouseout="mclosetime()">Products</a>
            <div id="m1"
                onmouseover="mcancelclosetime()" 
                onmouseout="mclosetime()">
            <a href="#">Monitors</a>
            <a href="#">Computers</a>
            <a href="#">Notebooks</a>
            <a href="#">Netbooks</a>
            </div>
    	</li>
        <li><a href="#" 
            onmouseover="mopen('m2')" 
            onmouseout="mclosetime()">Services</a>
            <div id="m2" 
                onmouseover="mcancelclosetime()" 
                onmouseout="mclosetime()">
            <a href="#">Service 1</a>
            <a href="#">Service 2</a>
            <a href="#">Service 3</a>
            <a href="#">Service 4</a>
            </div>
        </li>
        <li><a href="#">Stores</a></li>
        <li><a href="#">Help</a></li>
        <li><a href="#">Contact</a></li>
</ul>
<div style="clear:both"></div>

    
    </div>
    <div class="content">
    
    	<?php
                        //Use a switch statement to go through the URLS.
                        switch ($nav) {

						case "services":
                                include ('services.php');
                                break;

						case "aboutme":
                                include ('about.php');
                                break;

						case "portfolio":
                                include ('sites.php');
                                break;

						case "contact":
                                include ('contact.php');
                                break;

						case "services":
                                include ('services.php');
                                break;
                                                

                            default:
                                include ('default.php');
                                break;
                                
        
        
                        }
        
                        ?>
    
    </div>
</div>
</body>
</html>

 

so what am i doing wrong

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.