ja fordi der står jo ikke noget tal i value ved echo.. kun bogstaver.. så bliver den nul eller? for den den bliver vist ikke sat nogle steder..
<?php
if(isset($_POST['op'])) {
require "db.php";
$query1 = mysql_query("SELECT MAX(id) AS maxNum FROM cms_menu");
$maxNum1 = mysql_result($query1,0);
$newNum1 = $maxNum1+1;
$query2 = mysql_query("SELECT MAX(plac) AS maxNum FROM cms_menu");
$maxNum2 = mysql_result($query2,0);
$newNum2 = $maxNum2+1;
switch($_POST['fast'])
{
case 0:
echo "<table width=\"450\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#FF8282\">
<tr>
<td width=\"20\" valign=\"middle\" bgcolor=\"f4f3f3\"><img src=\"images/godkend.gif\" width=\"23\" height=\"25\"></td>
<td width=\"430\" valign=\"middle\" bgcolor=\"#f4f3f3\" class=\"godkendt_txt\">Du valgte ikke nogen side type.</td>
</tr>
</table><br>";
break;
case 1:
$link = "
http://casper1.wi2.ots.dk/otcms/site.php?id=$newNum1";$tekst = $_POST['tekst'];
$aktiv = $_POST['aktiv'];
$target = $_POST['target'];
$titel = $_POST['titel'];
$plac = $newNum2;
mysql_query("INSERT INTO cms_menu (tekst, aktiv, target, titel, link, plac) VALUES ('$tekst','$aktiv', '$target', '$titel', '$link', '$plac')") or die(mysql_error());
echo "<table width=\"450\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#FF8282\">
<tr>
<td width=\"20\" valign=\"middle\" bgcolor=\"f4f3f3\"><img src=\"images/godkend.gif\" width=\"23\" height=\"25\"></td>
<td width=\"430\" valign=\"middle\" bgcolor=\"#f4f3f3\" class=\"godkendt_txt\">Siden blev oprettet! <br> Der er flere funktioner under \"Rediger side/menu punkt\".</td>
</tr>
</table><br>";
break;
default:
$link = $_POST['fast'];
$aktiv = $_POST['aktiv'];
$target = $_POST['target'];
$titel = $_POST['titel'];
$plac = $newNum2;
mysql_query("INSERT INTO cms_menu (aktiv, target, titel, link, plac) VALUES ('$aktiv', '$target', '$titel', '$link', '$plac')") or die(mysql_error());
echo "<table width=\"450\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#FF8282\">
<tr>
<td width=\"20\" valign=\"middle\" bgcolor=\"f4f3f3\"><img src=\"images/godkend.gif\" width=\"23\" height=\"25\"></td>
<td width=\"430\" valign=\"middle\" bgcolor=\"#f4f3f3\" class=\"godkendt_txt\">Siden blev oprettet! <br> Der er flere funktioner under \"Rediger side/menu punkt\".</td>
</tr>
</table><br>";
}
}
?>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="table_site_top"><div align="left">Opret ny side </div></td>
<td class="table_site_top"><div align="right"><a href="index.php"><img src="images/menu_h_<?=$style?>.gif" alt="Tilbage til Quick ikoner" width="24" height="24" border="0"></a> <a href="java script: history.go(-1)"><img src="images/back_<?=$style?>.gif" alt="Gå en side tilbage" width="24" height="24" border="0"></a></div></td>
</tr>
<tr>
<td width="361" class="table_site_titel"><div align="center" class="style_link"></div></td>
<td width="162" class="table_site_titel"> </td>
<td width="127" class="table_site_titel"> </td>
</tr>
<tr>
<td colspan="3" class="table_site"><form action="menu_ny.php" method="post" enctype="multipart/form-data">
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" width="93%" height="88" class="tekst_normal">
<tr>
<td width="20%"><span class="style_link">Aktiv:</span></td>
<td width="45%"><select name="aktiv" class="input">
<option value="">Vælge status</option>
<option value="1">Ja</option>
<option value="2">Nej</option>
</select></td>
<td width="5%" onMouseOver="changeText('aktiv');" onMouseOut="changeText('text','')"><img src="images/help_<?=$style?>.gif" width="24" height="24"></td>
<td width="30%"> </td>
</tr>
<tr>
<td class="style_link">Target:</td>
<td><select name="target" class="input" id="target">
<option value="">Vælge status</option>
<option value="_self">_self</option>
<option value="_blank">_blank</option>
</select></td>
<td onMouseOver="changeText('target');" onMouseOut="changeText('text','')"><img src="images/help_<?=$style?>.gif" width="24" height="24"></td>
<td> </td>
</tr>
<tr>
<td class="style_link">Evt. Fast punkt:</td>
<td>
<select name="fast" class="input">
<option value="0">Vælge side type</option>
<option value="1">Text side</option>
<?php
require "db.php";
$sql2 = "SELECT * FROM cms_menu_fast";
$result2 = mysql_query($sql2);
while($row2 = mysql_fetch_array($result2))
{
echo "<option value=\"".$row2['url']."\">".$row2['navn']."</option>\n";
}
?>
</select></td>
<td onMouseOver="changeText('fast');" onMouseOut="changeText('text','')"><img src="images/help_<?=$style?>.gif" width="24" height="24"></td>
<td> </td>
</tr>
<tr>
<td><span class="style_link">Titel:</span></td>
<td colspan="3"><input type="text" name="titel" id="titel" class="input">
<input name="op" type="hidden" id="op" value="op"></td>
</tr>
<tr>
<td valign="top"><span class="style_link">Indhold:</span></td>
<td colspan="3"><textarea name="tekst" cols="30" rows="7" class="input" id="tekst"></textarea></td>
</tr>
<tr>
<td> </td>
<td colspan="3"><a onClick="submit();" class="cursor" onMouseOver="MM_swapImage('Image1','','images/gem_over.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="images/gem.gif" alt="Gem billede på forside" name="Image1" width="32" height="32" border="0" id="Image1"></a></td>
</tr>
</table>
<br>
</div>
</form>