Topic: Jag har lite problem med kod!
Hej jag undrar om det är någon som kan se vad det är för fel på detta Medlems brev - script, jag kan inte få det till att fungera, han som har gjort det säger att det fungerar bra hos honom!
admin.php:
<?
session_start();
include("data.php");
$conn = mysql_connect("$dbhost", "$dbuser", "$dbpass");
$week = date("W");
$week_next = ($week + 1);
if ($_GET['loggain'] == "yes") {
if (($_POST['user'] == $login) && ($_POST['losen'] == $pass)) {
setcookie ("admin","online", time()+3600);
header("location: admin.php");
} else {
echo "<font face='verdana' size='1' color='#000000'>fel användarnamn eller lösenord</font><br>";
}
}
print "<table width='100%' height='100%' cellpadding='0' cellspacing='0'>
<tr>
<td width='100%' height='100%' align='center' valign='middle'>
<table width='200' height='100' bgcolor='#666666' cellpadding='4' cellspacing='1'>
<tr>
<td width='100%' height='100%' bgcolor='#E8E8E8' valign='top' align='left'>";
if ($_COOKIE['admin'] == "online") {
if ($_GET['send'] == "true") {
$find = mysql_db_query("$databas", "select * from nyhet_members ORDER BY id DESC") or exit(mysql_error());
while ($r = mysql_fetch_array($find)) {
mail($r['email'], $_POST['rubrik'], $_POST['msg'], "From: ".$_POST['emailto']);
}
header("Location: admin.php?sended=true");
}
?>
<font face='verdana' size='1' color='#000000'>
<?
if ($_GET['sended'] == "true") {
echo "<b>Skickat!<br><br></B>";
}
?>
<B>INFO:<Br></B>Här skickar du ditt nyhets brev Till <b>ALLA</B> som är medlem.<br>
<form action="admin.php?send=true" method="post" onSubmit="submitonce(this)">
<b>Rubrik:</B><br>
<input type="text" name="rubrik" cols="30"><br>
<b>Din Email:</B><br>
<input type="text" name="emailto" cols="30"><br>
<b>Meddelande:</B><br>
<textarea rows="10" name="msg" cols="30"></textarea>
<br></font>
<input type="submit" value="Send">
</form>
<?
} else {
?>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<form action="admin.php?loggain=yes" method="post">
<table width="157" border="0" cellspacing="0" cellpadding="0" height="38">
<tr height="19">
<td align="right" valign="top" width="84" height="19"><font face='verdana' size='1' color='#000000'>användarnamn:</font></td>
<td align="left" valign="top" width="83" height="19"><input type="text" name="user" size="10"></td>
</tr>
<tr height="19">
<td align="right" valign="top" width="84" height="19"><font face='verdana' size='1' color='#000000'>lösenord:</font></td>
<td align="left" valign="top" width="83" height="19"><input type="password" name="losen" size="10"></td>
</tr>
</table>
<input type="submit" value="Logga In" border="0">
</form>
<? } ?>
</td>
</tr>
</table>
<table width="200" height="10" cellpadding="0" cellspacing="1">
<tr>
<td width="100%" height="100%" valign="top" align="right">
<font face="verdana" size="1" color="#000000">Script by <a href="mailto:webmaster@dis-vision.com">Luddep</a><br><a href="index.php">Back <<</a></font>
</td>
</tr>
</table>
</td>
</tr>
</table>