Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
PHP
  1  <?php include('config.php');?>
  2  <!DOCTYPE html>
  3  <html lang="tr">
  4  
  5  <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6    
  7  
  8    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9    <meta http-equiv="X-UA-Compatible" content="ie=edge">
 10    <title>SarıPuan┊Paylaş Kazan!</title>
 11    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
 12          integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">  
 13    <link rel="stylesheet" href="css/style.css">
 14    <link href="https://fonts.googleapis.com/css?family=Quicksand:400,500,600,700&display=swap" rel="stylesheet">
 15    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
 16      integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
 17    <link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
 18    <link rel="stylesheet" href="js/owl/owl.carousel.min.css">
 19    <link rel="stylesheet" href="js/owl/owl.theme.default.min.css">
 20  
 21    <script src='https://www.google.com/recaptcha/api.js'></script>
 22    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
 23    <link rel="apple-touch-icon" sizes="57x57" href="/fav/apple-icon-57x57.png">
 24    <link rel="apple-touch-icon" sizes="60x60" href="/fav/apple-icon-60x60.png">
 25    <link rel="apple-touch-icon" sizes="72x72" href="/fav/apple-icon-72x72.png">
 26    <link rel="apple-touch-icon" sizes="76x76" href="/fav/apple-icon-76x76.png">
 27    <link rel="apple-touch-icon" sizes="114x114" href="/fav/apple-icon-114x114.png">
 28    <link rel="apple-touch-icon" sizes="120x120" href="/fav/apple-icon-120x120.png">
 29    <link rel="apple-touch-icon" sizes="144x144" href="/fav/apple-icon-144x144.png">
 30    <link rel="apple-touch-icon" sizes="152x152" href="/fav/apple-icon-152x152.png">
 31    <link rel="apple-touch-icon" sizes="180x180" href="/fav/apple-icon-180x180.png">
 32    <link rel="icon" type="image/png" sizes="192x192" href="/fav/android-icon-192x192.png">
 33    <link rel="icon" type="image/png" sizes="32x32" href="/fav/favicon-32x32.png">
 34    <link rel="icon" type="image/png" sizes="96x96" href="/fav/favicon-96x96.png">
 35    <link rel="icon" type="image/png" sizes="16x16" href="/fav/favicon-16x16.png">
 36    <link rel="manifest" href="/manifest.json">
 37    <meta name="msapplication-TileColor" content="#ffffff">
 38    <meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
 39    <meta name="theme-color" content="#ffffff">
 40  </head>
 41  
 42  <body style="overflow: hidden;">
 43    <div id="loader">
 44      <div class="s1">
 45        <div class="s2"></div>
 46        <div class="s3"></div>
 47        <div class="s4"></div>
 48      </div>
 49    </div>
 50    <div id="main-content">
 51      <nav class="navbar navbar-expand-lg navbar-light navbar-custom sticky-top border-bottom">
 52        <div class="container">
 53          <a class="navbar-brand" href="<?if(isset($_SESSION['data'])){echo 'gorev.php';}else{echo 'index.php';}?>">
 54            <img src="img/logo.png" alt="" style="max-width: 75px;">
 55          </a>
 56          <button class="navbar-toggler navbar-custom-toggle" type="button">
 57            <span>
 58              
 59              ^__i class="lines">
 60            </span>
 61          </button>
 62          <div class="collapse navbar-collapse" id="navbarNav">
 63            <ul class="navbar-nav ml-auto custom-nav-ul align-items-center">
 64              <?if(isset($_SESSION['data'])) :?>
 65                <li class="nav-item active pr-2 pl-2">
 66                  <a class="nav-link pr-0 pl-0" href="#">SarıPuan: <?=$data['bakiye']?></a>
 67                </li>
 68                <li class="nav-item active pr-2 pl-2">
 69                  <a class="nav-link pr-0 pl-0" href="profil.php">Profil</a>
 70                </li>
 71                <li class="nav-item active pr-2 pl-2">
 72                  <a class="nav-link pr-0 pl-0" href="para-cek.php">SarıPuan Aktar</a>
 73                </li>
 74                <li class="nav-item active pr-2 pl-2">
 75                  <a class="nav-link pr-0 pl-0" href="gorevler.php">Geçmiş</a>
 76                </li>
 77                <li class="nav-item active pr-2 pl-2">
 78                  <a class="nav-link pr-0 pl-0" href="gorevyaptir.php">Kampanya Ekle</a>
 79                </li>
 80                <li class="nav-item active pr-2 pl-2">
 81                  <a class="nav-link pr-0 pl-0" href="logout.php">Çıkış Yap</a>
 82                </li>
 83              <?php else: ?>
 84                <li class="nav-item active pr-2 pl-2">
 85                    <a class="nav-link pr-0 pl-0" href="login.php">Giriş Yap</a>
 86                </li>
 87                <li class="nav-item active pr-2 pl-2">
 88                    <a class="nav-link pr-0 pl-0" href="register.php">Kayıt Ol</a>
 89                </li>
 90                <li class="nav-item active pr-2 pl-2">
 91                    <a class="nav-link pr-0 pl-0" href="faq.php">S.S.S</a>
 92                </li>
 93                <li class="nav-item active pr-2 pl-2">
 94                    <a class="nav-link pr-0 pl-0" href="gorevyaptir.php">Kampanya Ekle</a>
 95                </li>
 96                <li class="nav-item active pr-2 pl-2">
 97                    <a class="nav-link pr-0 pl-0" href="help.php">Bize Ulaşın</a>
 98                </li>
 99                <li class="nav-item active pr-2 pl-2">
100                    <a class="nav-link pr-0 pl-0" href="#"><img
101                            src="https://www.saripuan.com/kanite/English.svg" alt=""></a>
102                </li>
103              <?php 
104              endif; ?>      
105            </ul>
106          </div>
107        </div>
108      </nav>


What I have tried:

I tried to change the syntax but I was not successful somewhere I'm making an error but couldn't find it


Parse error: syntax error, unexpected 'else' (T_ELSE), expecting end of file in /storage/ssd4/592/14594592/public_html/header.php on line 84
Posted
Updated 13-Aug-20 0:46am
v5
Comments
Garth J Lancaster 13-Aug-20 6:03am    
First of all, you need to write a question such that we can help you - WTF is line 84 ?? no point posting a blob of code expecting that we can figure out where line 84 is - use Improve question and comment the line and/or use bold tags <b> and </b> around it
enes dogrul 13-Aug-20 6:13am    
im so sorry

PHP
<?php else: ?>

Error is with line this.

Example usage of if-else in PHP:
PHP
<?php
$t = date("H");

if ($t < "20") {
  echo "Have a good day!";
} else {
  echo "Have a good night!";
}
?>

Reference:
PHP if...else...elseif Statements[^]

Another example:
PHP
<?php

if ($a > $b):
    echo $a." is greater than ".$b;
elseif ($a == $b): // Note the combination of the words.
    echo $a." equals ".$b;
else:
    echo $a." is neither greater than or equal to ".$b;
endif;

?>

Reference: PHP: elseif/else if - Manual[^]

Looking at above, your PHP code is having if-else in another way that is not correct, hence the error.

Try:
PHP
<?php include('config.php');
.
.
.
.
.
if(isset($_SESSION['data'])) :
.
.
.
.
else: 
.
.
.
.
?>
 
Share this answer
 
v3
You have missed the PHP open control on all your if statements. Your code is:
PHP
<?if

which means the else and endif are unmatched. It should be
PHP
<?php if
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900