Komischer Fehler oO

Fragen zu allen Themen rund ums Programmieren außerhalb von phpBB können hier gestellt werden - auch zu anderen Programmiersprachen oder Software wie Webservern und Editoren.
Antworten
N33D H3LP
Mitglied
Beiträge: 19
Registriert: 13.05.2005 20:38

Komischer Fehler oO

Beitrag von N33D H3LP »

Ich habe das hier geproggt:
http://dead74.de.funpic.de/Neu%20Textdokument.txt

nun kommt aber immer der fehler
Parse error: parse error, unexpected $ in /usr/export/www/vhosts/funnetwork/hosting/dead74/angriffsplaner.php on line 255
was habe ich falsch gemacht???

EDIT//
Zeile 255 = </html>
shwepsi
Mitglied
Beiträge: 1697
Registriert: 02.06.2003 14:37
Wohnort: NRW - immer dem Monitorleuchten folgen...
Kontaktdaten:

Beitrag von shwepsi »

einen externen Link gesetzt....
keiner kann es ansehen
du musst es über eine html/php/etc Seite bei funpic verlinken...

und DANN kann dir geholfen werden
Die Weisheit verfolgte mich sekundenlang...
Aber sie überholte mich und war fortan nicht mehr gesehen !!!
Benutzeravatar
Blutgerinsel
Mitglied
Beiträge: 1801
Registriert: 19.07.2004 18:53
Wohnort: Landkreis Ulm
Kontaktdaten:

Beitrag von Blutgerinsel »

Externes Linken ist bei funpic untersagt....

Übersetze den Fehler dann weisst du das es
a) nicht abgeschlossene {}
b) $ wo keines erlaubt ist
etc.

liegen kann
N33D H3LP
Mitglied
Beiträge: 19
Registriert: 13.05.2005 20:38

Beitrag von N33D H3LP »

Code: Alles auswählen

<?
             //hier fängt das php an
            if(isset($_POST['kolo_start1']) OR isset($_POST['kolo_hilfe31']) OR isset($_POST['kolo_hilfe32']) OR isset($_POST['kolo_hilfe33']) OR isset($_POST['kolo_start2']) OR isset($_POST['kolo_start3']) OR isset($_POST['kolo_abstand1']) OR isset($_POST['kolo_abstand2']) OR isset($_POST['kolo_abstand3']) OR isset($_POST['kolo_zeit1']) OR isset($_POST['kolo_zeit2']) OR isset($_POST['kolo_zeit3']) OR isset($_POST['kolo_hilfe1']) OR isset($_POST['kolo_hilfe2']) OR isset($_POST['kolo_hilfe3']) OR isset($_POST['kolo_hilfe21']) OR isset($_POST['kolo_hilfe22']) OR isset($_POST['kolo_hilfe23'])) {
                echo "<p>\n";
               //prüft ob alles ausgefüllt wurde
                if(empty($_POST['kolo_start1']) OR empty($_POST['kolo_start2']) OR empty($_POST['kolo_start3'])) $fehler .= "<li>Sie haben vergessen ein Feld auszufüllen</li>"; {
                   //kommt wenn das kolo genauso lange braucht wie die 1.flotte
                    if((($_POST['kolo_start1'] * 60 + $_POST['kolo_start2']) * 60) + $_POST['kolo_start3'] + (($_POST['kolo_zeit1'] * 60 + $_POST['kolo_zeit2']) * 60 + $_POST['kolo_zeit3']) == $cleaner1) {
                        echo "          Nimm nur die 2.Flotte oder eine ganz andere Flotte!\n";
                    } else {
                    //kommt wenn das kolo genauso lange braucht wie die 2.flotte
                    if((($_POST['kolo_start1'] * 60 + $_POST['kolo_start2']) * 60) + $_POST['kolo_start3'] + (($_POST['kolo_zeit1'] * 60 + $_POST['kolo_zeit2']) * 60 + $_POST['kolo_zeit3']) == $cleaner2) {
                        echo "          Lass die 2.Flotte lieber weg!\n";
                    } else {
                     //wandelt alles in Sekunden um (zum rechnen besser)
                       //wann das kolo da ist (in sec)
                       $kolo_da = (($_POST['kolo_start1'] * 60 + $_POST['kolo_start2']) * 60) + $_POST['kolo_start3'] + (($_POST['kolo_zeit1'] * 60 + $_POST['kolo_zeit2']) * 60 + $_POST['kolo_zeit3']);
                       //anfahrt der 1.flotte in sec
                       $sec1 = $kolo_da - $abstand - $abstand - ((($_POST['kolo_hilfe1'] * 60 + $_POST['kolo_hilfe2']) * 60) + $_POST['kolo_hilfe3']);
                       //ankunft der 1.flotte
                       $sec1_ = $kolo_da - $abstand - $abstand;
                       //anfahrt der 2.flotte in sec
                       $sec2 = $kolo_da - $abstand -$abstand - $abstand - ((($_POST['kolo_hilfe21'] * 60 + $_POST['kolo_hilfe22']) * 60) + $_POST['kolo_hilfe23']);
                       //ankunft der 2.flotte
                       $sec2_ = $kolo_da - $abstand - $abstand - $abstand;
                       //abstand zwischen den flotten
                       $abstand = (($_POST['kolo_abstand1'] * 60 + $_POST['kolo_abstand2']) * 60) + $_POST['kolo_abstand3'];
                       //abfahrt vom bomber
					   $sec4 = $kolo_da - $abstand - ((($_POST['kolo_hilfe31'] * 60 + $_POST['kolo_hilfe32']) * 60) + $_POST['kolo_hilfe33']); 
					   //ankunft vom bomber
					   $sec4_ = $kolo_da - $abstand;
					   //damit zB 0 Tage steht
                       $tag1 = 0;
                       $tag1_ = 0;
                       $tag2 = 0;
                       $tag2_ = 0;
                       $tag3 = 0;
                       $tag3_ = 0;
					 //wichtig, wenn sec, min & h höher als 60 sind
                       while ($sec1 >= 60) {
                       $sec1 = $sec1 - 60;
                       $min1 = $min1 + 1;
                       }
                       while ($min1 >= 60) {
                       $min1 = $min1 - 60;
                       $h1 = $h1 + 1;
                       }
                       while ($h1 >= 24) {
                       $h1 = $h1 - 24;
                       $tag1 = $tag1 + 1;
                       }
                       while ($sec2 >= 60) {
                       $sec2 = $sec2 - 60;
                       $min2 = $min2 + 1;
                       }
                       while ($min2 >= 60) {
                       $min2 = $min2 - 60;
                       $h2 = $h2 + 1;
                       }
                       while ($h2 >= 24) {
                       $h2 = $h2 - 24;
                       $tag2 = $tag2 + 1;
                       }
                       while ($sec1_ >= 60) {
                       $sec1_ = $sec1_ - 60;
                       $min1_ = $min1_ + 1;
                       }
                       while ($min1_ >= 60) {
                       $min1_ = $min1_ - 60;
                       $h1_ = $h1_ + 1;
                       }
                       while ($h1_ >= 24) {
                       $h1_ = $h1_ - 24;
                       $tag1_ = $tag1_ + 1;
                       }
                       while ($sec2_ >= 60) {
                       $sec2_ = $sec2_ - 60;
                       $min2_ = $min2_ + 1;
                       }
                       while ($min2_ >= 60) {
                       $min2_ = $min2_ - 60;
                       $h2_ = $h2_ + 1;
                       }
                       while ($h2_ >= 24) {
                       $h2_ = $h2_ - 24;
                       $tag2_ = $tag2_ + 1;
                       }
                       while ($kolo_da >= 60) {
                       $kolo_da = $kolo_da - 60;
                       $min3 = $min3 + 1;
                       }
                       while ($min3 >= 60) {
                       $min3 = $min3 - 60;
                       $h3 = $h3 + 1;
                       }
                       while ($h3 >= 24) {
                       $h3 = $h3 - 24;
                       $tag3 = $tag3 + 1;
                       }
                       while ($sec4 >= 60) {
                       $sec4 = $sec4 - 60;
                       $min4 = $min4 + 1;
                       }
                       while ($min4 >= 60) {
                       $min4 = $min4 - 60;
                       $h4 = $h4 + 1;
                       }
                       while ($h4 >= 24) {
                       $h4 = $h4 - 24;
                       $tag4 = $tag4 + 1;
                       }
                       while ($sec4_ >= 60) {
                       $sec4_ = $sec4_ - 60;
                       $min4_ = $min4_ + 1;
                       }
                       while ($min4_ >= 60) {
                       $min4_ = $min4_ - 60;
                       $h4_ = $h4_ + 1;
                       }
                       while ($h4_ >= 24) {
                       $h4_ = $h4_ - 24;
                       $tag4_ = $tag4_ + 1;
                      }					   					
					}
				  }
               } 
         $endzeit=microtime()-$startzeit;
         echo $endzeit;
       //hier ist das php zu ende und das html bald auch :)
?>
<html>
<head>
<title>:: JPs Homepage - Angriffsplaner ::</title>
</head>
<body><center>
  <p><b>ANGRIFFSPLANER</b></p>
  </center><br>
<table width="696" border="1">
  <tr><b>
    <td width="160">Flotte</td>
    <td width="160">Dauer</td>
	<td width="160">Start</td>
    <td width="160">Ankunft</td>
  </b></tr>
  <tr>
    <td><b>Siedlungsschiff</b></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$kolo_zeit1.":".$kolo_zeit2.":".$kolo_zeit3."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$kolo_start1.":".$kolo_start2.":".$kolo_start3."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$h3.":".$min3.":".$kolo_da."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
  </tr>
  <tr>
    <td><b>Abst&auml;nde</b></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$kolo_abstand1.":".$kolo_abstand2.":".$kolo_abstand3."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
    <td>N/A</td>
    <td>N/A</td>
  </tr>
  <tr>
    <td><b>1.Cleaner</b></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$kolo_hilfe1.":".$kolo_hilfe2.":".$kolo_zeit3."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$h1.":".$min1.":".$sec1."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$h1_.":".$min1_.":".$sec1_."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
  </tr>
  <tr>
    <td><b>2.Cleaner</b></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$kolo_hilfe21.":".$kolo_hilfe22.":".$kolo_hilfe23."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$h2.":".$min2.":".$sec2."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$h2_.":".$min2_.":".$sec2_."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
  </tr>
  <tr>
    <td><b>Bomber</b></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$kolo_hilfe31.":".$kolo_hilfe32.":".$kolo_hilfe33."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$h4.":".$min4.":".$sec4."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
    <td><? 
	if(empty($fehler)) {
	echo "<p>".$h4_.":".$min4_.":".$sec4_."</p>";
	} else {
	echo "<p>$fehler</p>";
	}
	?></td>
  </tr>
</table>
</body>
</html>
shwepsi
Mitglied
Beiträge: 1697
Registriert: 02.06.2003 14:37
Wohnort: NRW - immer dem Monitorleuchten folgen...
Kontaktdaten:

Beitrag von shwepsi »

als erstes schaue mal mal nach wie man korrekt einrückt, dann siehst du nämlich das du ein } vergessen hast im oberen Teil (vor dem html Teil)
wo es genau hingehört weiss ich nicht, aber du machst dort halt ein { mehr auf als wieder zu

ist sehr praktisch, ganz gut ist es in phpBB gelöst, wenn auch nicht perfekt, aber wer ist das schon
Die Weisheit verfolgte mich sekundenlang...
Aber sie überholte mich und war fortan nicht mehr gesehen !!!
Antworten

Zurück zu „Coding & Technik“