Avatar billede wolstrup Nybegynder
05. juli 2005 - 14:36 Der er 18 kommentarer og
1 løsning

Bøvl med sessions

Har en menu brugeren kun skal se hvis den pågældende er logget ind. Starter session, men hvordan fikser jeg det med menuen?

side:
<?
session_start();
if (session_is_registered("brugernavn") AND ("kodeord") AND ("logintid")) {
?>
<?
}else{
print "<p align=center><b><font face=verdana size=2 color=white>Du er ikke logget ind!</font></p></b>";
}
?>
Velkommen <? echo $_SESSION[brugernavn]; ?>

menu:
<p align="left">
      <font face="Verdana">»</font>
      <a href="forum/index.php" style="text-decoration: none"><font color="#FFFFFF">IQ Forum</font></a>
      <br>
      <font face="Verdana">»</font>
      <a href="download.php" style="text-decoration: none"><font color="#FFFFFF">Downloads</font></a>
Avatar billede sungdk Nybegynder
05. juli 2005 - 16:30 #1
Du kan jo være smart at lave en session som fx. hedder "login" når brugeren er logget ind.

Så kan du hurtigere tjekke om brugeren er logget ind.

Bl.a. kan du nemt lave denne forespørgsel:

if (isset($_SESSION['login'])) {
//Din menu her!
} else {
echo "Du er ikke logget ind!";
}
Avatar billede kdjweb Nybegynder
05. juli 2005 - 17:53 #2
du kunne sætte:
$_SESSION['login'] == 1;

ind når du logger ind, og så på de ting som du vil sikrer sætter du bare:

if($_SESSION['login'] == 1){

  // du er logget ind

} else {

  echo "Fy, fy, kan du så logge på!";

}

ind ;D
Avatar billede wolstrup Nybegynder
05. juli 2005 - 19:45 #3
Har fået det til at virke nogenlunde, men forstår ikke at når jeg går ind på siden fucker mit design total op???

http://d141336.u25.surftown.dk/loginok.php

Det skulle normalt ligne dette:

http://d141336.u25.surftown.dk/


<?
session_start();
if (session_is_registered("brugernavn") AND ("kodeord") AND ("logintid")) {
?>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>BOMBLOAD</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>

<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" bgcolor="#111111">

<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="785" height="169">
    <tr>
      <td width="20" height="171" rowspan="15" background="gfx/sidev.gif">&nbsp;</td>
      <td width="750" height="160" bgcolor="#333300" colspan="5">
      <p align="center">
      <img border="0" src="../gfx/banner.jpg" width="720" height="145"></td>
      <td width="20" height="171" rowspan="15" background="gfx/sideh.gif">&nbsp;</td>
    </tr>
    <tr>
      <td width="750" height="40" bgcolor="#333300" colspan="5">
      <p align="center">
      <map name="FPMap0">
      <area coords="4, 6, 68, 34" shape="rect" href="index.php">
      <area coords="95, 6, 159, 34" shape="rect" href="news.php">
      <area coords="182, 4, 278, 34" shape="rect" href="band.php">
      <area coords="303, 6, 434, 34" shape="rect" href="disco.php">
      <area coords="446, 5, 523, 33" shape="rect" href="merch.php">
      <area coords="546, 6, 634, 33" shape="rect" href="gallery.php">
      <area coords="656, 6, 744, 32" shape="rect" href="contact.php">
      </map>
      <img border="0" src="gfx/menu.gif" usemap="#FPMap0" width="750" height="35"></td>
      </tr>
    <tr>
      <td width="170" height="1" bgcolor="#333300">
      <p>&nbsp;</td>
      <td width="35" height="15" bgcolor="#333300" rowspan="13">&nbsp;</td>
      <td width="535" height="19" bgcolor="#333300" colspan="3">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="30" bgcolor="#333300" background="gfx/barmenu.gif">&nbsp;</td>
      <td width="530" height="30" bgcolor="#333300" background="gfx/barmember.gif" colspan="2">&nbsp;</td>
      <td width="18" height="644" bgcolor="#333300" rowspan="12">&nbsp;
      </td>
      </tr>
    <tr>
      <td width="170" height="186" bgcolor="#000000" valign="top">
      <p align="center">&nbsp;
      </p>
      <p align="left">
      <?
              print "<a href=forum/index.php style=text-decoration: none><p align=left><font face=verdana size=1 color=white>» IQ Forum</font></p></a>";
              print "<a href=forum/download.php style=text-decoration: none><p align=left><font face=verdana size=1 color=white>» IQ Downloads</font></p></a>";
              ?>
<?
}else{
print "<img src=\"gfx/grenade.jpg\" align=\"middle\">";
}
?>
      </td>
      <td width="530" height="379" bgcolor="#000000" rowspan="5" colspan="2" valign="top">
      <p align="center">&nbsp;
Velkommen <? echo $_SESSION[brugernavn]; ?>
<p align="center">
<img border="0" src="gfx/member.gif" width="377" height="257"></p>
      </td>
      </tr>
    <tr>
      <td width="170" height="12" bgcolor="#333300" background="gfx/menub.gif">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="35" bgcolor="#333300">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="33" bgcolor="#333300" background="gfx/barlogin.gif">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="106" bgcolor="#000000" valign="top">
      <form action="index.php" method="POST">
      <input type="hidden" name="action" value="login">
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        Username:</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <input type="text" name="brugernavn" size="20"></p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">Password:</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <input type="password" name="kodeord" size="20"></p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <input type="submit" value="Login" name="submit"></p>
      </form>
      <p align="left" style="margin-top: 0; margin-bottom: 0">
      <font face="Verdana">»</font>
      <a href="opret.php" style="text-decoration: none"><font color="#FFFFFF">Register user</font></a><p align="left" style="margin-top: 0; margin-bottom: 0">
      <font face="Verdana">»</font>
      <a href="forgot.php" style="text-decoration: none"><font color="#FFFFFF">Forgot password</font></a> </td>
      </tr>
    <tr>
      <td width="170" height="7" bgcolor="#333300" background="gfx/menub.gif">&nbsp;</td>
      <td width="530" height="15" bgcolor="#333300" background="gfx/menuc.gif" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="38" bgcolor="#333300">&nbsp;</td>
      <td width="530" height="38" bgcolor="#333300" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="31" bgcolor="#333300" background="gfx/barnews.gif">&nbsp;</td>
      <td width="530" height="31" bgcolor="#333300" background="gfx/barforum.gif" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="62" bgcolor="#000000"><p align="center" style="margin-top: 0; margin-bottom: 0">
        Subscribe Newsletter</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        Email:</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <form method=post action="maillist.php">
        <input type="name" name="email"><br>
<input type="radio" name="action" value="subscribe" checked>Subscribe<br>
<input type="radio" name="action" value="unsubscribe">Unsubscribe<br>
<input type=submit value=subscribe><br></p>
      </td>
      <td width="145" height="95" bgcolor="#000000">
      <p align="center">
      <img border="0" src="gfx/profil.gif" width="110" height="83"></td>
      <td width="384" height="95" bgcolor="#000000">
      <table border="0" cellpadding="0" cellspacing="0" align="top">
        <td width="160"><font face=verdana size=1 color=white><b>Subject</b></font></td>
        <td width="140"><font face=verdana size=1 color=white><b>date</b></font></td>
        <td><font face=verdana size=1 color=white><b>replies</b></font></td><br>
</table>
<?
$database = mysql_connect("mydb2.surftown.dk","bruger","kode");
Mysql_select_db("bombloa_site",$database);
$foresp = mysql_query("SELECT * FROM forum_body ORDER BY ID DESC LIMIT 0,5");
While($data=mysql_fetch_row($foresp)) {
?>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">

 
<?
        if (strlen($data[1]) >= 22) {
$data[1] = substr("$data[1]", 0, 22);
$short = $data[1] . "...";
echo "<td width=160><font face=verdana size=1 color=white>$short</font></td>";
} else {
echo "<td width=160><font face=verdana size=1 color=white>$data[1]</font></td>";
}
?>
        <td width="140"><font face=verdana size=1 color=white><?print $data[4];?></font></td>
        <td><font face=verdana size=1 color=white><?print $data[6];?></font></td>

</table>
<?php
}
?>
      </td>
      </tr>
    <tr>
      <td width="170" height="17" bgcolor="#333300" background="gfx/menub.gif">&nbsp;</td>
      <td width="530" height="19" bgcolor="#333300" background="gfx/menuc.gif" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="37" bgcolor="#333300">&nbsp;</td>
      <td width="530" height="37" bgcolor="#333300" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="786" height="40" background="gfx/bund.gif" colspan="7" valign="top">
      <p align="center">Copyright © 2005 BOMBLOAD</td>
      </tr>
  </table>
  </center>
</div>
<p align="center">&nbsp;</p>

</body>

</html>
Avatar billede wolstrup Nybegynder
05. juli 2005 - 19:45 #4
Det ser kun sådan ud når jeg ikke er logget ind...
Avatar billede kdjweb Nybegynder
05. juli 2005 - 20:01 #5
if($_SESSION['login'] == 1){

<? echo "Velkommen " . $_SESSION[brugernavn]; ?>

} else {

  echo "<p align=center><b><font face=verdana size=2 color=white>Du er ikke logget ind!</font></p></b>";

} <----- husk at den skal være der inden din anden kode kommer
Avatar billede wolstrup Nybegynder
05. juli 2005 - 20:28 #6
Forstår det ikke, Bruger dette:

<?
session_start();
if (session_is_registered("brugernavn") AND ("kodeord") AND ("logintid")) {
?>
<?
              print "<a href=forum/index.php><p align=left><font face=verdana size=1 color=white>» IQ Forum</font></p></a>";
              print "<a href=forum/download.php><p align=left><font face=verdana size=1 color=white>» IQ Downloads</font></p></a>";
              ?>
<?
}else{
print "<img src=\"gfx/grenade.jpg\" align=\"middle\">";
}
?>

Men designet fucker stadig op?

Script som det er nu:
<?
session_start();
if (session_is_registered("brugernavn") AND ("kodeord") AND ("logintid")) {
?>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>BOMBLOAD</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>

<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" bgcolor="#111111">

<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="785" height="169">
    <tr>
      <td width="20" height="171" rowspan="15" background="gfx/sidev.gif">&nbsp;</td>
      <td width="750" height="160" bgcolor="#333300" colspan="5">
      <p align="center">
      <img border="0" src="../gfx/banner.jpg" width="720" height="145"></td>
      <td width="20" height="171" rowspan="15" background="gfx/sideh.gif">&nbsp;</td>
    </tr>
    <tr>
      <td width="750" height="40" bgcolor="#333300" colspan="5">
      <p align="center">
      <map name="FPMap0">
      <area coords="4, 6, 68, 34" shape="rect" href="index.php">
      <area coords="95, 6, 159, 34" shape="rect" href="news.php">
      <area coords="182, 4, 278, 34" shape="rect" href="band.php">
      <area coords="303, 6, 434, 34" shape="rect" href="disco.php">
      <area coords="446, 5, 523, 33" shape="rect" href="merch.php">
      <area coords="546, 6, 634, 33" shape="rect" href="gallery.php">
      <area coords="656, 6, 744, 32" shape="rect" href="contact.php">
      </map>
      <img border="0" src="gfx/menu.gif" usemap="#FPMap0" width="750" height="35"></td>
      </tr>
    <tr>
      <td width="170" height="1" bgcolor="#333300">
      <p>&nbsp;</td>
      <td width="35" height="15" bgcolor="#333300" rowspan="13">&nbsp;</td>
      <td width="535" height="19" bgcolor="#333300" colspan="3">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="30" bgcolor="#333300" background="gfx/barmenu.gif">&nbsp;</td>
      <td width="530" height="30" bgcolor="#333300" background="gfx/barmember.gif" colspan="2">&nbsp;</td>
      <td width="18" height="644" bgcolor="#333300" rowspan="12">&nbsp;
      </td>
      </tr>
    <tr>
      <td width="170" height="186" bgcolor="#000000" valign="top">
      <p align="center">&nbsp;
      </p>
      <p align="left">
      <?
              print "<a href=forum/index.php><p align=left><font face=verdana size=1 color=white>» IQ Forum</font></p></a>";
              print "<a href=forum/download.php><p align=left><font face=verdana size=1 color=white>» IQ Downloads</font></p></a>";
              ?>
<?
}else{
print "<img src=\"gfx/grenade.jpg\" align=\"middle\">";
}
?>
      </td>
      <td width="530" height="379" bgcolor="#000000" rowspan="5" colspan="2" valign="top">
      <p align="center">&nbsp;

<p align="center">
<img border="0" src="gfx/member.gif" width="377" height="257"></p>
      </td>
      </tr>
    <tr>
      <td width="170" height="12" bgcolor="#333300" background="gfx/menub.gif">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="35" bgcolor="#333300">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="33" bgcolor="#333300" background="gfx/barlogin.gif">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="106" bgcolor="#000000" valign="top">
      <form action="index.php" method="POST">
      <input type="hidden" name="action" value="login">
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        Username:</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <input type="text" name="brugernavn" size="20"></p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">Password:</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <input type="password" name="kodeord" size="20"></p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <input type="submit" value="Login" name="submit"></p>
      </form>
      <p align="left" style="margin-top: 0; margin-bottom: 0">
      <font face="Verdana">»</font>
      <a href="opret.php" style="text-decoration: none"><font color="#FFFFFF">Register user</font></a><p align="left" style="margin-top: 0; margin-bottom: 0">
      <font face="Verdana">»</font>
      <a href="forgot.php" style="text-decoration: none"><font color="#FFFFFF">Forgot password</font></a> </td>
      </tr>
    <tr>
      <td width="170" height="7" bgcolor="#333300" background="gfx/menub.gif">&nbsp;</td>
      <td width="530" height="15" bgcolor="#333300" background="gfx/menuc.gif" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="38" bgcolor="#333300">&nbsp;</td>
      <td width="530" height="38" bgcolor="#333300" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="31" bgcolor="#333300" background="gfx/barnews.gif">&nbsp;</td>
      <td width="530" height="31" bgcolor="#333300" background="gfx/barforum.gif" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="62" bgcolor="#000000"><p align="center" style="margin-top: 0; margin-bottom: 0">
        Subscribe Newsletter</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        Email:</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <form method=post action="maillist.php">
        <input type="name" name="email"><br>
<input type="radio" name="action" value="subscribe" checked>Subscribe<br>
<input type="radio" name="action" value="unsubscribe">Unsubscribe<br>
<input type=submit value=subscribe><br></p>
      </td>
      <td width="145" height="95" bgcolor="#000000">
      <p align="center">
      <img border="0" src="gfx/profil.gif" width="110" height="83"></td>
      <td width="384" height="95" bgcolor="#000000">
      <table border="0" cellpadding="0" cellspacing="0" align="top">
        <td width="160"><font face=verdana size=1 color=white><b>Subject</b></font></td>
        <td width="140"><font face=verdana size=1 color=white><b>date</b></font></td>
        <td><font face=verdana size=1 color=white><b>replies</b></font></td><br>
</table>
<?
$database = mysql_connect("mydb2.surftown.dk","bruger","kode");
Mysql_select_db("bombloa_site",$database);
$foresp = mysql_query("SELECT * FROM forum_body ORDER BY ID DESC LIMIT 0,5");
While($data=mysql_fetch_row($foresp)) {
?>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">

 
<?
        if (strlen($data[1]) >= 22) {
$data[1] = substr("$data[1]", 0, 22);
$short = $data[1] . "...";
echo "<td width=160><font face=verdana size=1 color=white>$short</font></td>";
} else {
echo "<td width=160><font face=verdana size=1 color=white>$data[1]</font></td>";
}
?>
        <td width="140"><font face=verdana size=1 color=white><?print $data[4];?></font></td>
        <td><font face=verdana size=1 color=white><?print $data[6];?></font></td>

</table>
<?php
}
?>
      </td>
      </tr>
    <tr>
      <td width="170" height="17" bgcolor="#333300" background="gfx/menub.gif">&nbsp;</td>
      <td width="530" height="19" bgcolor="#333300" background="gfx/menuc.gif" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="37" bgcolor="#333300">&nbsp;</td>
      <td width="530" height="37" bgcolor="#333300" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="786" height="40" background="gfx/bund.gif" colspan="7" valign="top">
      <p align="center">Copyright © 2005 BOMBLOAD</td>
      </tr>
  </table>
  </center>
</div>
<p align="center">&nbsp;</p>

</body>

</html>
Avatar billede kdjweb Nybegynder
05. juli 2005 - 20:37 #7
if (session_is_registered("brugernavn") AND ("kodeord") AND ("logintid")) {

skub den linie ned til toppen af
              print "<a href=forum/index.php><p align=left><font face=verdana size=1 color=white>» IQ Forum</font></p></a>";
              print "<a href=forum/download.php><p align=left><font face=verdana size=1 color=white>» IQ Downloads</font></p></a>";
Avatar billede wolstrup Nybegynder
05. juli 2005 - 20:40 #8
Så skriver den: Parse error: parse error, unexpected $ in /hsphere/local/home/bombload/bombload.com/loginok.php on line 183
som er den sidste line på siden, altså </html>
Avatar billede wolstrup Nybegynder
05. juli 2005 - 20:44 #9
Det var fordi jeg glemte at slette linien øverst, nu udskriver den billet lige meget om man logger ind eller ej. Altså somom man ikke er logget ind.
Avatar billede kdjweb Nybegynder
05. juli 2005 - 20:46 #10
jeg prøver lige at rette din kode
Avatar billede kdjweb Nybegynder
05. juli 2005 - 20:49 #11
<?
session_start();
?>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>BOMBLOAD</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>

<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" bgcolor="#111111">

<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="785" height="169">
    <tr>
      <td width="20" height="171" rowspan="15" background="gfx/sidev.gif">&nbsp;</td>
      <td width="750" height="160" bgcolor="#333300" colspan="5">
      <p align="center">
      <img border="0" src="../gfx/banner.jpg" width="720" height="145"></td>
      <td width="20" height="171" rowspan="15" background="gfx/sideh.gif">&nbsp;</td>
    </tr>
    <tr>
      <td width="750" height="40" bgcolor="#333300" colspan="5">
      <p align="center">
      <map name="FPMap0">
      <area coords="4, 6, 68, 34" shape="rect" href="index.php">
      <area coords="95, 6, 159, 34" shape="rect" href="news.php">
      <area coords="182, 4, 278, 34" shape="rect" href="band.php">
      <area coords="303, 6, 434, 34" shape="rect" href="disco.php">
      <area coords="446, 5, 523, 33" shape="rect" href="merch.php">
      <area coords="546, 6, 634, 33" shape="rect" href="gallery.php">
      <area coords="656, 6, 744, 32" shape="rect" href="contact.php">
      </map>
      <img border="0" src="gfx/menu.gif" usemap="#FPMap0" width="750" height="35"></td>
      </tr>
    <tr>
      <td width="170" height="1" bgcolor="#333300">
      <p>&nbsp;</td>
      <td width="35" height="15" bgcolor="#333300" rowspan="13">&nbsp;</td>
      <td width="535" height="19" bgcolor="#333300" colspan="3">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="30" bgcolor="#333300" background="gfx/barmenu.gif">&nbsp;</td>
      <td width="530" height="30" bgcolor="#333300" background="gfx/barmember.gif" colspan="2">&nbsp;</td>
      <td width="18" height="644" bgcolor="#333300" rowspan="12">&nbsp;
      </td>
      </tr>
    <tr>
      <td width="170" height="186" bgcolor="#000000" valign="top">
      <p align="center">&nbsp;
      </p>
      <p align="left">
      <?
      if (session_is_registered("brugernavn") AND ("kodeord") AND ("logintid")) {
        print "<a href=forum/index.php><p align=left><font face=verdana size=1 color=white>» IQ Forum</font></p></a>";
        print "<a href=forum/download.php><p align=left><font face=verdana size=1 color=white>» IQ Downloads</font></p></a>";
       

      }else{
        print "<img src=\"gfx/grenade.jpg\" align=\"middle\">";
      }
      ?>
      </td>
      <td width="530" height="379" bgcolor="#000000" rowspan="5" colspan="2" valign="top">
      <p align="center">&nbsp;

<p align="center">
<img border="0" src="gfx/member.gif" width="377" height="257"></p>
      </td>
      </tr>
    <tr>
      <td width="170" height="12" bgcolor="#333300" background="gfx/menub.gif">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="35" bgcolor="#333300">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="33" bgcolor="#333300" background="gfx/barlogin.gif">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="106" bgcolor="#000000" valign="top">
      <form action="index.php" method="POST">
      <input type="hidden" name="action" value="login">
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        Username:</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <input type="text" name="brugernavn" size="20"></p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">Password:</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <input type="password" name="kodeord" size="20"></p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <input type="submit" value="Login" name="submit"></p>
      </form>
      <p align="left" style="margin-top: 0; margin-bottom: 0">
      <font face="Verdana">»</font>
      <a href="opret.php" style="text-decoration: none"><font color="#FFFFFF">Register user</font></a><p align="left" style="margin-top: 0; margin-bottom: 0">
      <font face="Verdana">»</font>
      <a href="forgot.php" style="text-decoration: none"><font color="#FFFFFF">Forgot password</font></a> </td>
      </tr>
    <tr>
      <td width="170" height="7" bgcolor="#333300" background="gfx/menub.gif">&nbsp;</td>
      <td width="530" height="15" bgcolor="#333300" background="gfx/menuc.gif" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="38" bgcolor="#333300">&nbsp;</td>
      <td width="530" height="38" bgcolor="#333300" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="31" bgcolor="#333300" background="gfx/barnews.gif">&nbsp;</td>
      <td width="530" height="31" bgcolor="#333300" background="gfx/barforum.gif" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="62" bgcolor="#000000"><p align="center" style="margin-top: 0; margin-bottom: 0">
        Subscribe Newsletter</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        Email:</p>
        <p align="center" style="margin-top: 0; margin-bottom: 0">
        <form method=post action="maillist.php">
        <input type="name" name="email"><br>
<input type="radio" name="action" value="subscribe" checked>Subscribe<br>
<input type="radio" name="action" value="unsubscribe">Unsubscribe<br>
<input type=submit value=subscribe><br></p>
      </td>
      <td width="145" height="95" bgcolor="#000000">
      <p align="center">
      <img border="0" src="gfx/profil.gif" width="110" height="83"></td>
      <td width="384" height="95" bgcolor="#000000">
      <table border="0" cellpadding="0" cellspacing="0" align="top">
        <td width="160"><font face=verdana size=1 color=white><b>Subject</b></font></td>
        <td width="140"><font face=verdana size=1 color=white><b>date</b></font></td>
        <td><font face=verdana size=1 color=white><b>replies</b></font></td><br>
</table>
<?
$database = mysql_connect("mydb2.surftown.dk","bruger","kode");
Mysql_select_db("bombloa_site",$database);
$foresp = mysql_query("SELECT * FROM forum_body ORDER BY ID DESC LIMIT 0,5");
While($data=mysql_fetch_row($foresp)) {
?>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">


<?
        if (strlen($data[1]) >= 22) {
$data[1] = substr("$data[1]", 0, 22);
$short = $data[1] . "...";
echo "<td width=160><font face=verdana size=1 color=white>$short</font></td>";
} else {
echo "<td width=160><font face=verdana size=1 color=white>$data[1]</font></td>";
}
?>
        <td width="140"><font face=verdana size=1 color=white><?print $data[4];?></font></td>
        <td><font face=verdana size=1 color=white><?print $data[6];?></font></td>

</table>
<?php
}
?>
      </td>
      </tr>
    <tr>
      <td width="170" height="17" bgcolor="#333300" background="gfx/menub.gif">&nbsp;</td>
      <td width="530" height="19" bgcolor="#333300" background="gfx/menuc.gif" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="170" height="37" bgcolor="#333300">&nbsp;</td>
      <td width="530" height="37" bgcolor="#333300" colspan="2">&nbsp;</td>
      </tr>
    <tr>
      <td width="786" height="40" background="gfx/bund.gif" colspan="7" valign="top">
      <p align="center">Copyright © 2005 BOMBLOAD</td>
      </tr>
  </table>
  </center>
</div>
<p align="center">&nbsp;</p>

</body>

</html>
Avatar billede wolstrup Nybegynder
05. juli 2005 - 21:02 #12
Jamen det er så smukt! Tusinde tak for hjælpen!
Avatar billede wolstrup Nybegynder
05. juli 2005 - 21:05 #13
Forresten ved du hvordan man fjerne stregen under linkene i menuen? og fjerner det store mellemrum mellem de to link? Bare for at være ekstra bøvlet :-)
Avatar billede kdjweb Nybegynder
05. juli 2005 - 21:21 #14
hehe jeg har ikke været inde på siden :D man det er med noget med style
Avatar billede wolstrup Nybegynder
05. juli 2005 - 21:23 #15
Det er de har fætre :-)

        print "<a href=forum/index.php><p align=left><font face=verdana size=1 color=white>» IQ Forum</font></p></a>";
        print "<a href=forum/download.php><p align=left><font face=verdana size=1 color=white>» IQ Downloads</font></p></a>";
Avatar billede kdjweb Nybegynder
05. juli 2005 - 21:28 #16
print "<a href=forum/index.php style=\"text-decoration: none\"><p align=left style=\"margin-top: 0; margin-bottom: 0\">><font face=verdana size=1 color=white>» IQ Forum</font></p></a>";
print "<a href=forum/download.php style=\"text-decoration: none\"><p align=left style=\"margin-top: 0; margin-bottom: 0\">><font face=verdana size=1 color=white>» IQ Downloads</font></p></a>";
Avatar billede wolstrup Nybegynder
05. juli 2005 - 21:35 #17
Takker :-)
Avatar billede kdjweb Nybegynder
05. juli 2005 - 22:08 #18
skal jeg kaste et svar? ;D
Avatar billede wolstrup Nybegynder
05. juli 2005 - 22:11 #19
Helt sikkert!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester