Her har jeg opretkam:
<?php include 'top.php'; ?>
<?
if(isset($_SESSION['brugernavn'], $_SESSION['kodeord']))
{
include ("config.php");
$mand = mysql_query("SELECT * FROM vip_brugere WHERE email = '$_SESSION[brugernavn]'") or die(mysql_error());
$vis = mysql_fetch_array($mand);
if($vis['admin'] != "nej") {
?>
<form action="tilfojkam_ok.php">
Tekst: <br>
<input type="text" name="tekst"><br>
Kampagnelink: <br>
<input type="text" name="link"><br>
Udløbsdato: <br>
<select name="dato">
<?php
$dato = 1;
while($dato <= 31) {
echo "<option value=\"$dato\">$dato</option>";
$dato++;
}
?>
</select>
<select name="maaned">
<option value="1">Januar</option>
<option value="2">Februar</option>
<option value="3">Marts</option>
<option value="4">April</option>
<option value="5">Maj</option>
<option value="6">Juni</option>
<option value="7">Juli</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">Oktober</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<select name="aar">
<?php
$detteAar = 2020;
$aar = 2007;
while($aar <= $detteAar) {
echo "<option value=\"$aar\">$aar</option>";
$aar++;
}
?>
</select><br>
Kategori: <br>
<select name="type">
<option value="1">Konkurrence</option>
<option value="2">Køb</option>
<option value="3">Klik</option>
<option value="4">Spørgeskema</option>
<option value="5">Nyhedsbrev</option>
<option value="6">Udenfor kategori</option>
</select>
<br><br>
<input type="submit" value="Tilføj Kampagne"></form>
<?
}
}
include 'bund.php'; ?>
og opretkam_ok
<?php include 'top.php'; ?>
<?
if(isset($_SESSION['brugernavn'], $_SESSION['kodeord']))
{
include ("config.php");
$mand = mysql_query("SELECT * FROM vip_brugere WHERE email = '$_SESSION[brugernavn]'") or die(mysql_error());
$vis = mysql_fetch_array($mand);
if($vis['admin'] != "nej") {
?>
<?
$tekst = $_REQUEST['tekst'];
$link = $_REQUEST['link'];
$dag = $_REQUEST['dato'];
$maaned = $_REQUEST['maaned'];
$aar = $_REQUEST['aar'];
$type = $_REQUEST['type'];
if($tekst == "" OR $link == "" OR $dag == "" OR $maaned == "" OR $aar == "" OR $type == "") {
echo 'Du har glemt at udfylde et, eller flere felter';
}else{
mysql_query("INSERT INTO vip_kampagner (tekst, link, type, uplob)values ('$tekst', '$link', '$type', dato???)") or die(mysql_error()); {
echo 'Kampagen er nu oprettet!';
}
}
}
}
?>
<?
include 'bund.php';
?>
Hvordan vil jeg så kunne gøre?