-2

I got this error but have no idea where i made a mistake. It would be really great if you could help me im not really good in php.

Fatal error: Cannot redeclare top() (previously declared in /Applications/XAMPP/xamppfiles/htdocs/newapproach/utils/head.php:3) in /Applications/XAMPP/xamppfiles/htdocs/newapproach/utils/head.php on line 62

The code is:

<?php 
include 'nav.php';
function top($location, $pagename, $name, $seclevel, $slider, $fancy){
    $pre = '';
    if ($location == 1){
        $pre = '../';
    }
    if ($name) {
        $navedit = navnon($location1);
    }else{
        $navedit = navuser($username, $location1);
    }
    $text = '<!Doctype HTML>
    <html>
    <head>
    '.logo().'
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="'.$pre.'css/nav.css" />';
    if ($slider){
        $text .= '<link rel="stylesheet" href="'.$pre.'css/flexslider.css" type="text/css">';
    }
    if ($fancy){
        $text .= '<link rel="stylesheet" href="'.$pre.'fancy/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />';
    }
    $text .= '<title>ABI 2015 - '.$pagename.'</title>
    <script src="'.$pre.'js/jquery.min.js"></script>';

    if($slider){
        $text .= '<script src="'.$pre.'js/jquery.flexslider.js"></script>';
    }
    if ($fancy){
        $text .= '<script type="text/javascript" src="'.$pre.'/fancy/jquery.fancybox-1.3.4.pack.js"></script>';
    }
    $text .= '<script type="text/javascript">
    $(document).ready(function(){
        $("a#ex").click(function(){
            alert(unescape("Dies ist ein Externer Link die WEB-seite %FCbernimmt keine Verantwortung f%FCr externe Links und die Inhalte auf den verlinkten Seite."));
        });';
    if ($slider){
        $text .= '  $(".flexslider").flexslider({
            animation: "fade",
            animationLoop: true,
            slideshow:true,
            controlNav:false,
        });';
    }
    if ($fancy){
        $text .= '$("a.inline").fancybox({
                "hideOnContentClick": false;
            });';
    }
    $text .= '});
    </head>
    <body id="bg">
    <div id="feedback"><a href="'.$pre.'html/feedback.html"><img src="'.$pre.'pic/feedback.png"/></a></div>
    '.$navedit.'
        <div id="line">';   
    return $text;
}
?>
Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
ClemensFricke
  • 31
  • 2
  • 2

1 Answers1

0

Seems like you have already declared the function top() in your nav.php file.

Just call it. You dont have to declare it again.

Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126