Announcement

Collapse
No announcement yet.

IF befehl geht nicht

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • IF befehl geht nicht

    hallo ich hab da ein einfaches script geschrieben das menü mit if befehlen gemacht aber es geht nicht und ich find denn fehler einfach nicht ich hab schon ein paar leute gefragt nichts könnt ihr mir bitte weiter helfen

    da ist das script

    PHP Code:
    <html>
    <head><title>Movimento</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
    <body bgcolor="#000000" text="#CCCCCC" link="#FF0000" vlink="#FF0000" alink="#FF0000">
    <table width="1194" height="750" align="center">
      <tr> 
      <tr> 
        <td  width="250" height="250" background="bilder/logo.jpg"> </td>
        <td  width="700" height="250" background="bilder/bannerhintergrund.jpg"> <div align="center">Banner</div></td>
        <td width="250" height="250" background="bilder/links.jpg"> </td>
      </tr>
        <td width="250" height="125" background="bilder/linksrechts.jpg"><div align="center"><img src="bilder/menue/allgemeinmenue.png" width="230" height="115" border="0" usemap="#Map2"></div></td>
        <td width="650" rowspan="4"> 
          <?php
            
    if(goto == "home")
                {
                include(
    "home.php");
                }
                
            if(goto == 
    "programm")
                {
                require(
    "programm.php");
                }    
            if(goto == 
    "chronologie")
                {
                include(
    "mp3.txt");
                }
            if(goto == 
    "asozial")
                {
                include(
    "asozial.php");
                }
            if(goto == 
    "ueclub")
                {
                include(
    "ueclub.php");
                }
            if(goto == 
    "download")
                {
                include(
    "download.php");
                }
            if(goto == 
    "forum")
                {
                include(
    "forum.txt");
                }
            if(goto == 
    "impressum")
                {
                include(
    "impressum.php");
                }
            else
                {
                echo 
    "In Arbeit";
                }

            
    ?>

          <div align="center"></div></td>
      <td width="250" height="125" background="bilder/gigsrechts.jpg">&nbsp;</td>
      </tr>
      <tr> 
        <td width="250" height="125" background="bilder/linksrechts.jpg"><div align="center"><img src="bilder/menue/sonstigesmenue.png" width="230" height="115"><br>
          </div></td>
        <td width="250" height="125" background="bilder/userlogin.jpg">&nbsp;</td>
      </tr>
      <tr> 
        <td width="250" height="125" background="bilder/linksrechts.jpg">&nbsp;</td>
        <td width="250" height="125" background="bilder/menuerechts.jpg">&nbsp;</td>
      </tr>
      <tr> 
        <td width="250" height="125" background="bilder/linksrechts.jpg">&nbsp; </td>
        <td width="250" height="125" background="bilder/menuerechts.jpg">&nbsp;</td>
      </tr>
    </table>
    <map name="Map2">
      <area shape="rect" coords="119,4,174,29" href="$goto%20==%20home">
    </map>

    </body>
    </html>
    mfg prikle

  • #2
    Hallo prikle,

    Ab PHP 4.2.0 ist der standardmäßige Wert für die PHP-Anweisung register_globals off. Dadurch wird die Variable $goto nicht automatisch registriert. Es wäre besser stattdessen auf $_GET['goto'] zurückzugreifen.

    Gruß falk
    Wenn du denkst du hast alle Bugs gefunden, dann ist das ein Bug in deiner Denksoftware.

    Quellcode ohne ein Mindestmaß an Formatierung sehe ich mir nicht an! Ich leiste keinen Privatsupport per Mail oder PN!

    Comment


    • #3
      Zumal goto (Konstante) nicht gleich $goto (Variable) ist.

      Stefan
      >e-novative> - We make IT work for you.
      http://www.e-novative.de

      Comment


      • #4
        also ihr meind zb.:

        <?php
        if(goto == "home")
        {
        include("home.php");
        }


        <a href="$_GET['goto']=home">home</a>

        Comment


        • #5
          Eher so:

          <?php
          if($_GET['goto'] == "home")
          {
          include("home.php");
          }

          <a href="?goto=home">home</a>
          ?>

          Stefan
          >e-novative> - We make IT work for you.
          http://www.e-novative.de

          Comment

          Working...
          X