Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Php lief nicht
#1
Originalcode: https://hastebin.com/hajetumixo.makefile
Eine fast ganze Seite nur als echo ausgeben ist bestimmt keine gute Idee.
Das können dir aber andere bestimmt besser sagen.
Ich würde das echo weglassen und so wie du es hattest konnte er gar keine else if erkennung machen ob deine Session vorhanden ist.
Außerdem wahr dein html etwas verdreht. <style> sollte wenn es schon im  html steht ganz oben im stehen. Besser wäre auslagern
Ich würde es dann so versuchen.
PHP-Code:
<?php
session_start
();
if(!isset(
$_SESSION['userid'])) {
 
   die('Bitte zuerst <a href="login.php">einloggen</a>');
}
if(isset(
$_SESSION['staff'])) {
?>

<html>
<head>
<title>Supportarea | PlayGalaxy</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700' rel='stylesheet' type='text/css'>
<style>
@import url(https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css);
@import url(https://fonts.googleapis.com/css?family=Lato:300,400,700);
body {
    font-family: 'Lato', sans-serif;
    background: #353535;
    color: black;
}
.jumbotron h1 {
    color: #353535;
}
footer {
  margin-bottom: 0 !important;
  margin-top: 80px;
}
footer p {
  margin: 0;
  padding: 0;
}
span.icon {
    margin: 0 5px;
    color: #D64541;
}
h2 {
    color: black;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.mrng-60-top {
    margin-top: 60px;
}
/* Global Button Styles */
a.animated-button:link, a.animated-button:visited {
    position: relative;
    display: block;
    margin: 30px auto 0;
    padding: 14px 15px;
    color: #fff;
    font-size:14px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    overflow: hidden;
    letter-spacing: .08em;
    border-radius: 0;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(0, 0, 0, 0.2);
    -webkit-transition: all 1s ease;
    -moz-transition: all 1s ease;
    -o-transition: all 1s ease;
    transition: all 1s ease;
}
a.animated-button:link:after, a.animated-button:visited:after {
    content: "";
    position: absolute;
    height: 0%;
    left: 50%;
    top: 50%;
    width: 150%;
    z-index: -1;
    -webkit-transition: all 0.75s ease 0s;
    -moz-transition: all 0.75s ease 0s;
    -o-transition: all 0.75s ease 0s;
    transition: all 0.75s ease 0s;
}
a.animated-button:link:hover, a.animated-button:visited:hover {
    color: #FFF;
    text-shadow: none;
}
a.animated-button:link:hover:after, a.animated-button:visited:hover:after {
    height: 450%;
}
a.animated-button:link, a.animated-button:visited {
    position: relative;
    display: block;
    margin: 30px auto 0;
    padding: 14px 15px;
    color: #fff;
    font-size:14px;
    border-radius: 0;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    overflow: hidden;
    letter-spacing: .08em;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(0, 0, 0, 0.2);
    -webkit-transition: all 1s ease;
    -moz-transition: all 1s ease;
    -o-transition: all 1s ease;
    transition: all 1s ease;
}

/* Victoria Buttons */
a.animated-button.victoria-one {
    border: 2px solid #D24D57;
}
a.animated-button.victoria-one:after {
    background: #D24D57;
    -moz-transform: translateX(-50%) translateY(-50%) rotate(-25deg);
    -ms-transform: translateX(-50%) translateY(-50%) rotate(-25deg);
    -webkit-transform: translateX(-50%) translateY(-50%) rotate(-25deg);
    transform: translateX(-50%) translateY(-50%) rotate(-25deg);
}
a.animated-button.victoria-two {
    border: 2px solid #D24D57;
}
a.animated-button.victoria-two:after {
    background: #D24D57;
    -moz-transform: translateX(-50%) translateY(-50%) rotate(25deg);
    -ms-transform: translateX(-50%) translateY(-50%) rotate(25deg);
    -webkit-transform: translateX(-50%) translateY(-50%) rotate(25deg);
    transform: translateX(-50%) translateY(-50%) rotate(25deg);
}
a.animated-button.victoria-three {
    border: 2px solid #D24D57;
}
a.animated-button.victoria-three:after {
    background: #D24D57;
    opacity: .5;
    -moz-transform: translateX(-50%) translateY(-50%);
    -ms-transform: translateX(-50%) translateY(-50%);
    -webkit-transform: translateX(-50%) translateY(-50%);
    transform: translateX(-50%) translateY(-50%);
}
a.animated-button.victoria-three:hover:after {
    height: 140%;
    opacity: 1;
}
a.animated-button.victoria-four {
    border: 2px solid #D24D57;
}
a.animated-button.victoria-four:after {
    background: #D24D57;
    opacity: .5;
    -moz-transform: translateY(-50%) translateX(-50%) rotate(90deg);
    -ms-transform: translateY(-50%) translateX(-50%) rotate(90deg);
    -webkit-transform: translateY(-50%) translateX(-50%) rotate(90deg);
    transform: translateY(-50%) translateX(-50%) rotate(90deg);
}
a.animated-button.victoria-four:hover:after {
    opacity: 1;
    height: 600% !important;
}
/* Sandy Buttons */

a.animated-button.sandy-one {
    border: 2px solid #AEA8D3;
    color: #FFF;
}
a.animated-button.sandy-one:after {
    border: 3px solid #AEA8D3;
    opacity: 0;
    -moz-transform: translateX(-50%) translateY(-50%);
    -ms-transform: translateX(-50%) translateY(-50%);
    -webkit-transform: translateX(-50%) translateY(-50%);
    transform: translateX(-50%) translateY(-50%);
    
}
a.animated-button.sandy-one:hover:after {
    height: 120% !important;
    opacity: 1;
    color: #FFF;
}
a.animated-button.sandy-two {
    border: 2px solid #AEA8D3;
    color: #FFF;
}
a.animated-button.sandy-two:after {
    border: 3px solid #AEA8D3;
    opacity: 0;
    -moz-transform: translateY(-50%) translateX(-50%) rotate(90deg);
    -ms-transform: translateY(-50%) translateX(-50%) rotate(90deg);
    -webkit-transform: translateY(-50%) translateX(-50%) rotate(90deg);
    transform: translateY(-50%) translateX(-50%) rotate(90deg);
}
a.animated-button.sandy-two:hover:after {
    height: 600% !important;
    opacity: 1;
    color: #FFF;
}
a.animated-button.sandy-three {
    border: 2px solid #AEA8D3;
    color: #FFF;
}
a.animated-button.sandy-three:after {
    border: 3px solid #AEA8D3;
    opacity: 0;
    -moz-transform: translateX(-50%) translateY(-50%) rotate(-25deg);
    -ms-transform: translateX(-50%) translateY(-50%) rotate(-25deg);
    -webkit-transform: translateX(-50%) translateY(-50%) rotate(-25deg);
    transform: translateX(-50%) translateY(-50%) rotate(-25deg);
}
a.animated-button.sandy-three:hover:after {
    height: 400% !important;
    opacity: 1;
    color: #FFF;
}
a.animated-button.sandy-four {
    border: 2px solid #AEA8D3;
    color: #FFF;
}
a.animated-button.sandy-four:after {
    border: 3px solid #AEA8D3;
    opacity: 0;
    -moz-transform: translateY(-50%) translateX(-50%) rotate(25deg);
    -ms-transform: translateY(-50%) translateX(-50%) rotate(25deg);
    -webkit-transform: translateY(-50%) translateX(-50%) rotate(25deg);
    transform: translateY(-50%) translateX(-50%) rotate(25deg);
}
a.animated-button.sandy-four:hover:after {
    height: 400% !important;
    opacity: 1;
    color: #FFF;
}
/* Gibson Buttons */

a.animated-button.gibson-one {
    border: 2px solid #65b37a;
    color: #FFF;
}
a.animated-button.gibson-one:after {
    opacity: 0;
    background-image: -webkit-linear-gradient( transparent 50%, rgba(101,179,122,0.2) 50%);
    background-image: -moz-linear-gradient(transparent 50%, rgba(101,179,122,0.2) 50%);
    background-size: 10px 10px;
    -moz-transform: translateX(-50%) translateY(-50%) rotate(25deg);
    -ms-transform: translateX(-50%) translateY(-50%) rotate(25deg);
    -webkit-transform: translateX(-50%) translateY(-50%) rotate(25deg);
    transform: translateX(-50%) translateY(-50%) rotate(25deg);
}
a.animated-button.gibson-one:hover:after {
    height: 600% !important;
    opacity: 1;
    color: #FFF;
}
a.animated-button.gibson-two {
    border: 2px solid #65b37a;
    color: #FFF;
}
a.animated-button.gibson-two:after {
    opacity: 0;
    background-image: -webkit-linear-gradient( transparent 50%, rgba(101,179,122,0.2) 50%);
    background-image: -moz-linear-gradient(transparent 50%, rgba(101,179,122,0.2) 50%);
    background-size: 10px 10px;
    -moz-transform: translateX(-50%) translateY(-50%) rotate(-25deg);
    -ms-transform: translateX(-50%) translateY(-50%) rotate(-25deg);
    -webkit-transform: translateX(-50%) translateY(-50%) rotate(-25deg);
    transform: translateX(-50%) translateY(-50%) rotate(-25deg);
}
a.animated-button.gibson-two:hover:after {
    height: 600% !important;
    opacity: 1;
    color: #FFF;
}
a.animated-button.gibson-three {
    border: 2px solid #65b37a;
    color: #FFF;
}
a.animated-button.gibson-three:after {
    opacity: 0;
    background-image: -webkit-linear-gradient( transparent 50%, rgba(101,179,122,0.2) 50%);
    background-image: -moz-linear-gradient(transparent 50%, rgba(101,179,122,0.2) 50%);
    background-size: 10px 10px;
    -moz-transform: translateX(-50%) translateY(-50%) rotate(90deg);
    -ms-transform: translateX(-50%) translateY(-50%) rotate(90deg);
    -webkit-transform: translateX(-50%) translateY(-50%) rotate(90deg);
    transform: translateX(-50%) translateY(-50%) rotate(90deg);
}
a.animated-button.gibson-three:hover:after {
    height: 600% !important;
    opacity: 1;
    color: #FFF;
}
a.animated-button.gibson-four {
    border: 2px solid #65b37a;
    color: #FFF;
}
a.animated-button.gibson-four:after {
    opacity: 0;
    background-image: -webkit-linear-gradient( transparent 50%, rgba(101,179,122,0.2) 50%);
    background-image: -moz-linear-gradient(transparent 50%, rgba(101,179,122,0.2) 50%);
    background-size: 10px 10px;
    -moz-transform: translateX(-50%) translateY(-50%);
    -ms-transform: translateX(-50%) translateY(-50%));
    -webkit-transform: translateX(-50%) translateY(-50%);
    transform: translateX(-50%) translateY(-50%);
}
a.animated-button.gibson-four:hover:after {
    height: 600% !important;
    opacity: 1;
    color: #FFF;
}
/* Thar Buttons */

a.animated-button.thar-one {
    color: #fff;
    cursor: pointer;
    display: block;
    position: relative;
    border: 2px solid #F7CA18;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
}
a.animated-button.thar-one:hover {
    color: #000 !important;
    background-color: transparent;
    text-shadow: none;
}
a.animated-button.thar-one:hover:before {
    bottom: 0%;
    top: auto;
    height: 100%;
}
a.animated-button.thar-one:before {
    display: block;
    position: absolute;
    left: 0px;
    top: 0px;
    height: 0px;
    width: 100%;
    z-index: -1;
    content: '';
    color: #000 !important;
    background: #F7CA18;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
}
a.animated-button.thar-two {
    color: #fff;
    cursor: pointer;
    display: block;
    position: relative;
    border: 2px solid #F7CA18;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
}
a.animated-button.thar-two:hover {
    color: #000 !important;
    background-color: transparent;
    text-shadow: ntwo;
}
a.animated-button.thar-two:hover:before {
    top: 0%;
    bottom: auto;
    height: 100%;
}
a.animated-button.thar-two:before {
    display: block;
    position: absolute;
    left: 0px;
    bottom: 0px;
    height: 0px;
    width: 100%;
    z-index: -1;
    content: '';
    color: #000 !important;
    background: #F7CA18;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
}
a.animated-button.thar-three {
    color: #fff;
    cursor: pointer;
    display: block;
    position: relative;
    border: 2px solid #F7CA18;
    transition: all 0.4s cubic-bezier(0.42, 0, 0.58, 1);
0s;
}
a.animated-button.thar-three:hover {
    color: #000 !important;
    background-color: transparent;
    text-shadow: nthree;
}
a.animated-button.thar-three:hover:before {
    left: 0%;
    right: auto;
    width: 100%;
}
a.animated-button.thar-three:before {
    display: block;
    position: absolute;
    top: 0px;
    right: 0px;
    height: 100%;
    width: 0px;
    z-index: -1;
    content: '';
    color: #000 !important;
    background: #F7CA18;
    transition: all 0.4s cubic-bezier(0.42, 0, 0.58, 1);
0s;
}
a.animated-button.thar-four {
    color: #fff;
    cursor: pointer;
    display: block;
    position: relative;
    border: 2px solid #F7CA18;
    transition: all 0.4s cubic-bezier(0.42, 0, 0.58, 1);
0s;
}
a.animated-button.thar-four:hover {
    color: #000 !important;
    background-color: transparent;
    text-shadow: nfour;
}
a.animated-button.thar-four:hover:before {
    right: 0%;
    left: auto;
    width: 100%;
}
a.animated-button.thar-four:before {
    display: block;
    position: absolute;
    top: 0px;
    left: 0px;
    height: 100%;
    width: 0px;
    z-index: -1;
    content: '';
    color: #000 !important;
    background: #F7CA18;
    transition: all 0.4s cubic-bezier(0.42, 0, 0.58, 1);
0s;
}
    
    table, th, td {
    border: 0px solid black;
    border-collapse: collapse;
        text-align: center;
}
th, td {
    padding: 5px;
    text-align: center;  
}
    
body{
  margin:0;
  padding:0;
    text-decoration: none;
    text-align: center;
            background-image: url(background.png)
}
    
.Achtung{
        color: darkred;
        font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
}
    
.stafftheme{
        
    background-color: white;
}
</style>
</head>
<body>
    <br>
    <img class="img animated bounceinleft" src="img/Logo.png">
 <div class="container"> 
  <!-- Example row of columns -->
<div class="row">
    <div class="col-md-12 text-center">
     <br><br>
    </div>
  </div>
<div class="row animated bounceinleft">
    <div class="col-md-3 col-sm-3 col-xs-6"> <a href="staff-allgemein.php" class="btn btn-sm animated-button victoria-one">Allgemeines</a> </div>
    <div class="col-md-3 col-sm-3 col-xs-6"> <a href="staff-tb.php" class="btn btn-sm animated-button victoria-two">Teambesprechungen</a> </div>
    <div class="col-md-3 col-sm-3 col-xs-6"> <a href="staff-support.php" class="btn btn-sm animated-button victoria-three">Supportarea</a> </div>
    <div class="col-md-3 col-sm-3 col-xs-6"> <a href="ez/login.php" class="btn btn-sm animated-button victoria-four">Mod/Admin Area</a> </div>
 </div>
</div><br><br><div class="animated bounceinup">
<h2>SUPPORTAREA</h2>
<table style="width:100%">
<tr>
<th><h1>Ban eintragen</h1>
<p>Klicke <a href="https://discord.gg/xdHjdFR">hier</a> um Deinen Ban einzutragen.</p> <br><br>
<td><h1>Reports einsehen</h1>
<p>Klicke <a href="https://discord.gg/32qw6Qc">hier</a> um alle Reports und Details zu sehen.</p> </td>
</tr>
</table>
<table style="width:100%">
 <tr>
<th><h1>Registrierte User</h1>
<p>Klicke <a href="https://discord.gg/xdHjdFR">hier</a> um alle registrierten User zu sehen.</p> <br><br>
<td><h1>Supportbereich wechseln</h1>
<p>Klicke <a href="https://discord.gg/32qw6Qc">hier</a> um eine Anfrage zu stellen.</p> </td>
</tr>
</table>  </div>
</body>
 </html>
<?php
echo '<a href="logout.php">Log dich aus</a>';
}else{
echo 
"<h2>Error</h2>Du hast keinen Admin Status <a href='geheim.php'>Zum Passwort gesicherten Bereich zurück</a>";
}
?>

Fals einer das anders Lösen würde dann immer raus damit
Zitieren
#2
Moin,

auch ich habe eine eigene Variante geschrieben. Diese lagert aber den Inhalt aus dem Body in zwei weitere PHP-Dateien aus:

PHP-Code:
<?php
sesion_start
();
if(isset(
$_SESSION['staff']) && $_SESSION['staff'] == "staff") {
    $contentpage "php/staff.php";
} else {
    $contentpage "php/login.php";
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $meinTitel?></title>
    <link rel="stylesheet" href="css/meinCSS.css">
    <script src="js/meinScript.js"></script>
</head>
<body>
    <?php
        
if(file_exists($contentpage)) {
            include_once($contentpage);
        } else {
            echo "Kein Inhalt vorhande";
        }
    ?>
</body>
</html> 

Gruss rzscout
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen:
1 Gast/Gäste