Big Bob: einfach neue Seite fürs echo

Also so wie das Script da steht setzt der das echo "lol" einfach ans ende des Html Text . Er soll aber das echo "lol" auf eine neue Seite tun . Bin dankbar für jede Hilfe .

<html>

<head>
<title>Neue Seite 1</title>
</head>

<body>

<form method="POST" action="<?php $php_self ?>">
    <table border="0" width="1234">
    <tr>
      <td width="65">Name:</td>
      <td><input type="text" name="Name" size="20"></td>
    </tr>
    <tr>
      <td width="65">Passwort : </td>
      <td><input type="text" name="Passwort" size="20"></td>
    </tr>
  </table>
  <p><input type="submit" value="Abschicken" ></p>
</form>

</body>

</html>
<?php

if (isset($Name))
{
 echo "lol";
}
?>

  1. Hi,

    <html>

    <head>
    <title>Neue Seite 1</title>
    </head>

    <body>

    <form method="POST" action="<?php $php_self ?>">
        <table border="0" width="1234">
        <tr>
          <td width="65">Name:</td>
          <td><input type="text" name="Name" size="20"></td>
        </tr>
        <tr>
          <td width="65">Passwort : </td>
          <td><input type="text" name="Passwort" size="20"></td>
        </tr>
      </table>
      <p><input type="submit" value="Abschicken" ></p>
    </form>

    </body>

    </html>
    <?php

    if (isset($Name))
    {
    echo "lol";
    }
    ?>

    warum verwendest Du nicht einfach eine neue Seite? Du musst doch nur als ACTION im Form-Tag eine andere Datei angeben.
    Ansonsten erweitere Deine if-Abfrage um einen else-Block und lass Das ganze HTML-Zeugs mit echo innerhalb des else-Teils ausgeben.

    Viele Grüsse,
    Achim

  2. Also so wie das Script da steht setzt der das echo "lol" einfach ans ende des Html Text . Er soll aber das echo "lol" auf eine neue Seite tun . Bin dankbar für jede Hilfe .

    <html>

    <head>
    <title>Neue Seite 1</title>
    </head>

    <body>

    <form method="POST" action="<?php $php_self ?>">
        <table border="0" width="1234">
        <tr>
          <td width="65">Name:</td>
          <td><input type="text" name="Name" size="20"></td>
        </tr>
        <tr>
          <td width="65">Passwort : </td>
          <td><input type="text" name="Passwort" size="20"></td>
        </tr>
      </table>
      <p><input type="submit" value="Abschicken" ></p>
    </form>

    </body>

    </html>
    <?php

    if (isset($Name))
    {
    echo "lol";
    }
    ?>

    schreib um den html teil doch auch einfach eine if anweisung !
    nach dem motto
     if(!$Name) {
     echo "HTML";
    }

    viel erfolg
    Marcel D Wegermann

  3. Hi,

    also ich mache das immer so:

    <html>
    <head>
    </head>
    <body>

    <?php
      if (!isset($sAction)) {
        ?>
        <form action="<?php $php_self ?>">
        <input type="hidden" name="sAction" value="DoEcho"><br>
        <input type="text" name="sEchoThis"><br>
        <input type="submit" value="Zeig her">
        <?
      }
      else {
        switch ($sAction) {
          case "DoEcho":
            echo DoEcho($sEchoThis);
            break;

    default:
            echo "Sorry, Aktion unbekannt<br>";
            break;
        }
      }

    function DoEcho($sEchoThis) {
        echo $sEchoThis;
      }
    ?>

    </body>
    </html>

    Also so wie das Script da steht setzt der das echo "lol" einfach ans ende des Html Text . Er soll aber das echo "lol" auf eine neue Seite tun . Bin dankbar für jede Hilfe .

    <html>

    <head>
    <title>Neue Seite 1</title>
    </head>

    <body>

    <form method="POST" action="<?php $php_self ?>">
        <table border="0" width="1234">
        <tr>
          <td width="65">Name:</td>
          <td><input type="text" name="Name" size="20"></td>
        </tr>
        <tr>
          <td width="65">Passwort : </td>
          <td><input type="text" name="Passwort" size="20"></td>
        </tr>
      </table>
      <p><input type="submit" value="Abschicken" ></p>
    </form>

    </body>

    </html>
    <?php

    if (isset($Name))
    {
    echo "lol";
    }
    ?>