Php Page Geht Nich Warum?

mannita

Grünschnabel
Hi leute,


Ich bin noch ziemlich neu in php.
Ich hab so einfach wie möglich versucht ne page zu machen.
ich habs halt mit if(${QUERY_STRING}==""}:

ich hab das so gemacht wie in dem tutorial das ich dazu hab, dann hab ich halt noch bisschen dran rum geschraubt, das des auch aussieht wie ne Clanpage. Aber dann kommt so ein MIST

hier mal der code:
PHP:
[masta</title>");
?>

<?php if(${QUERY_STRING}==""}:?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="news"):?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="member"):?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="about"):?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="forum"):?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="guestbook"):?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="clanwars"):?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="downloads"):?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="links"):?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="contact"):?>
<? $title ?>
<?php endif; ?>
<?php if(${QUERY_STRING}=="server"):?>
<? $title ?>
<?php endif; ?>
</head>
<body>
<table width="790" align="center" border="1" cellspacing="0" bordercolor="#000000">
<tr>
    <td width="790" height="110" valign="top"><img src="images/tnbanner.jpg"></td>
</tr>
<tr>
    <td width="125" height="600" valign="top">
<img src="images/point.gif"> <a href="index.php">.:News:.</a><br>
<img src="images/point.gif"> <a href="index.php?member">.:Member:.</a><br>
<img src="images/point.gif"> <a href="index.php?about">.:About:.</a><br>
<img src="images/point.gif"> <a href="index.php?forum">.:Forum:.</a><br>
<img src="images/point.gif"> <a href="index.php?guestbook">.:Guestbook:.</a><br>
<img src="images/point.gif"> <a href="index.php?clanwars">.:Clanwars:.</a><br>
<img src="images/point.gif"> <a href="index.php?downloads">.:Downoads:.</a><br>
<img src="images/point.gif"> <a href="index.php?links">.:Links:.</a><br>
<img src="images/point.gif"> <a href="index.php?contact">.:Kontakt:.</a><br>
<img src="images/point.gif"> <a href="index.php?server">.:Server:.</a><br>
</td>
    <td width="540" valign="top">
    <?php if(${QUERY_STRING}==""}:?>
    <?php INCLUDE"news.txt";?>
    <?php endif; ?>
    <?php if(${QUERY_STRING}=="member"}:?>
    <?php INCLUDE"members.php";?>
    <?php endif; ?>
    <?php if(${QUERY_STRING}=="about"}:?>
    <?php INCLUDE"about.php";?>
    <?php endif; ?>
    <?php if(${QUERY_STRING}=="forum"}:?>
    <?php INCLUDE"forum.php"; ?>
    <?php endif; ?>
    <?php if(${QUERY_STRING}=="gustbook"}:?>
    <?php INCLUDE"guestbook.php"; ?>
    <?php endif; ?>
    <?php if(${QUERY_STRING}=="clanwars"}:?>
    <?php INCLUDE"clanwars.php"; ?>
    <?php endif; ?>
    <?php if(${QUERY_STRING}=="downloads"}:?>
    <?php INCLUDE"downloads.php?>
    <?php endif; ?>
    <?php if(${QUERY_STRING}=="links"}:?>
    <?php INCLUDE"links.php"?>
    <?php endif; ?>
    <?php if(${QUERY_STRING}=="contact"}:?>
    <?php INCLUDE"contact.php";?>
    <?php endif; ?>
    <?php if(${QUERY_STRING}=="server"}:?>
    <?php INCLUDE"server.php";?>
    <?php endif; ?>
    </td>
    <td width="125" valign="top">
    <table width="80%" align="center" border="1" bordercolor="#000000" cellspacing="0">
<tr>
    <td>Next War</td>
</tr>
<tr>
    <td height="80"><center><br><br>n/a
        </center></td>
    </td>
</tr>
</table>
</body>
</html>




Ich hoffe ihr könnt mir helfen, ihr könnt den script ja so bearbeiten das er geht und mir schicken , nur wenn ihr wollt natürlich.


MEINE EMAIL
 
ohne mir das script richtig durchzulesen, möcht ich nur sagen, dasses daran liegen könnte, dass man den code nicht so machen muss:
PHP:
<? //phpzeugs; ?>
<? //mehr phpzeugs; ?>
sondern besser so
PHP:
<? //phpzeugs;
//phpzeugs...;
//noch mehr phpzeugs;
?>
...., oder?

ich bin mir nicht sicher, ob das *DER* fehler ist, aber einer isses bestimmt *g* :)

hope that helps =)
 
PHP:
<?php INCLUDE"downloads.php?>
am besten noch in
PHP:
<?php INCLUDE('downloads.php'); ?>
(oder so ähnlich *g*) ändern :)
 
Hab das mal alles schnell überflogen. Probier mal anstatt
PHP:
<?php if(${QUERY_STRING}==""}:?>
<? $title ?>
<?php endif; ?>
diese "Schreibweise"
PHP:
<?php
if ($QUERY_STRING == "")
{
    echo $title;
}
____________________

Anstatt
PHP:
[masta</title>");
dies
PHP:
[masta</title>";
Außerdem musst du ja eine quelle haben, in der der Inhalt von $QUERY_STRING definiert sein sollte ... bzw die Variable sollte überhaupt existieren ...

Ich geb dir nen Tipp: Lern PHP ^^
http://www.schattenbaum.net/php/ und http://www.webmaster-resource.de/tutorials/php/php_lehrgang.php4 bieten da den besten einstieg

Edit: Wer ist der Author dieses besch****** Tuts ?
Ich mein ich bin auch nicht grad der Ober PHP-Guru, aber sowas ... nenene

Grüße, Morph
 
Zuletzt bearbeitet:
Hi

Also vielleicht mach ich das jetzt komisch aber ich mach das komplett anders ich hab zwar auch viele tutorials gesehen aber ich finds so einfacher und übersichtlicher
so sieht bei mir zB. eine main.php aus:
PHP:
<?php
include ('config.inc.php');

// news_oder_deine_seite.php

<?php include ('header.php'); ?>
<?php include ('bannerrot.php'); ?>
<?php include ('newsheader.php'); ?>
<?php include ('leftmenu.php'); ?>
<?php include ('news_oder_deine_seite.php'); ?>
<?php include ('rightmenu.php'); ?>
<?php include ('disclaimer.php'); ?>
<?php include ('footer.php'); ?>
?>
is natürlich nur ein vorschlag aber vielleicht tust dir so leicher und die datei wird auch nicht so schwer als bei der anderen methode
 
Mir ist da nochne Methode eingefallen
PHP:
switch($action)
{
    case "news": include(news.php);
    break;  // News

    case "termine": include(member.php);
    break;  // Members

    // usw ...
}
*untested* ^^

Grüße, Morph
 
Zuletzt bearbeitet:
PHP:
<?php
include ('config.inc.php');

// news_oder_deine_seite.php

<?php include ('header.php'); ?>
<?php include ('bannerrot.php'); ?>
<?php include ('newsheader.php'); ?>
<?php include ('leftmenu.php'); ?>
<?php include ('news_oder_deine_seite.php'); ?>
<?php include ('rightmenu.php'); ?>
<?php include ('disclaimer.php'); ?>
<?php include ('footer.php'); ?>
?>
??? wäre nich
PHP:
<?php
include ('config.inc.php');

// news_oder_deine_seite.php

include ('header.php');
include ('bannerrot.php');
include ('newsheader.php'); 
include ('leftmenu.php'); 
include ('news_oder_deine_seite.php');
include ('rightmenu.php'); 
include ('disclaimer.php');
include ('footer.php'); 
?>
besser? weil doppelter php-tag? geht das? und wozu das überhaupt? sorry, wennich falschliege :)
 
Nene @ stephan01, hast da schon recht
Aber das beste wäre, wenn mannita wenigstens bissl PHP "pauken" würd - weil was bringt es ihm wenn wir hier code posten wie wild und er nichts davon versteht ? ^^

Grüße, Morph
 
Ich bin fett dabei php zu "pauken"

aber des is halt net so leicht wenn man au noch auf die schule

geht. vielleicht begreif ich des ja irgendwann mal. :p
 
Zurück