Es soll das nur einmal ausgeben!

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

  • Es soll das nur einmal ausgeben!

    das meiste ist nur html, aber ich hab bei dem login script, das prob, das er jedes mal für jeden user der in der datenbank tabelle steht einmal sie haben keine recht ausgibt. es soll die tabelle durchsuchen und dann nur einmal sagen sie haben keine rechte.

    PHP Code:
    if ($page=="admin")
    {
    $sql="SELECT * FROM 2n_admin_admins";
    $holen=mysql_query($sql);
    $num=mysql_num_rows($holen);

    for (
    $i=0$i $num$i++)
    {
    $ausgabe=mysql_fetch_array($holen);

    if (
    $username=="$ausgabe[username]&& $passwort=="$ausgabe[passwort]")
    {
    echo
    "
    <meta http-equiv=\"refresh\" content=\"1; URL=http://
    $ausgabe[username]:$ausgabe[passwort]@2networks.de/admin/index.php\">
    <p>&nbsp;</p>
    <table width=\"450\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
          <tr> 
            <td background=\"daten/tb/tb_big/tb_topbg_o.jpg\" colspan=\"2\" height=\"22\"> 
              <div align=\"center\"><font size=\"2.5\"><b>Admin Bereich</b></font></div>
            </td>
            <tr> 
            <td background=\"daten/tb/tb_big/tb_middle.jpg\" colspan=\"2\" height=\"20\"> 
            <div align=\"center\"><font size=\"2.5\">
            <br>
            Du bist unter dem Benutzernamen: <font color=\"#000099\">"
    .$username."</font> eingeloggt!<br>
            Gleich geht es weiter zum Admin Bereich!
            </font></div>
            </td>
            </tr>
            <tr> 
            <td background=\"daten/tb/tb_big/tb_end.jpg\" colspan=\"2\" height=\"22\">
            &nbsp; 
            </td>
            </tr>
    </table>
    "
    ;
    }
    else
    {
    echo
    "
    <p>&nbsp;</p>
    <table width=\"450\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
          <tr> 
            <td background=\"daten/tb/tb_big/tb_topbg_o.jpg\" colspan=\"2\" height=\"22\"> 
              <div align=\"center\"><font size=\"2.5\"><b>Admin-Bereich</b></font></div>
            </td>
            <tr> 
            <td background=\"daten/tb/tb_big/tb_middle.jpg\" colspan=\"2\" height=\"20\"> 
            <div align=\"center\"><font size=\"2.5\">
            <br>
            Sie haben keine Rechte für den Admin Bereich.
            </font></div>
            </td>
            </tr>
            <tr> 
            <td background=\"daten/tb/tb_big/tb_end.jpg\" colspan=\"2\" height=\"22\">
            &nbsp; 
            </td>
            </tr>
    </table>
    "
    ;
    }
    }


  • #2
    wie wäre es, wenn du nur den relevanten code postest.
    und dann solltest du mal deine logik prüfen.

    so gehts bestimmt besser.....
    PHP Code:
    if ($page=="admin")
    {
    $sql="SELECT * FROM 2n_admin_admins WHERE user = '....' LIMIT 1";
    $holen=mysql_query($sql) or die(mysql_error());
    if (
    mysql_num_rows($holen)==1)
    {
      echo 
    "du hast rechte";
    }
    else
    {
      echo 
    "hau ab du doof";
    }

    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


    Comment

    Working...
    X