Witam, od jakiegos czasu próbuje do kolumny
snightmode w tabeli
smaplist wstawić wartość pola <object> w formularzu
addmap_form.php
Wartość to 1 lub 2 tylko że są one pobierane z tabeli
snightmode z kolumny
nmid (IMG:
style_emoticons/default/smile.gif) Napisałem skrypt lecz do tabelki zawsze mi wstawi wartość 0
oto skrypty:
addmap_form:
<h3>ADD YOUR MAP.</h3>
<h6>description</h6>
<table border="0">
<form method="post" action="index.php?dzial=form2" ENCTYPE="multipart/form-data">
<tr>
<th width=" 90">
<h4>
Name:
<h4>
</th>
<th align="left">
<h4><input id="form1" name="mapname" type="text" size="30" MAXLENGTH="25" value=""> ?</h4>
</th>
</tr>
<br>
<tr>
<th width="90">
<h4>
Type:
<h4>
</th>
<th align="left">
<h4><select id="form1" name="ssize">
<option value="1">Town/City</option>
<option value="2">Race</option>
<option value="3">Task</option>
<option value="4">Arena</option>
<option value="5">Co-op</option>
<option value="6">Remake</option>
<option value="7">Other</option>
</select> ?</h4>
</th>
</tr>
<br>
<tr>
<th width="90">
<h4>
Size:
<h4>
</th>
<th align="left">
<h4><select id="form1" name="smaptype">
<option value="1">S</option>
<option value="2">M</option>
<option value="3">L</option>
<option value="4">XL</option>
<option value="5">XXL</option>
<option value="6">XXXL</option>
</select> ?</h4>
</th>
</tr>
<tr>
<th width="90">
<h4>
Nightmode:
<h4>
</th>
<th align="left">
<h4>
<select name="nightmode" id="form1">
<?
require("conf.php");
$wynik = mysql_query("select * from snightmode order by nmid", $conn); {
echo $wiersz["nightmode"];
}
?>
</select> ?</h4>
</th>
</tr>
<tr>
<th width=" 90">
<h4>
Id:
<h4>
</th>
<th align="left">
<h4><input id="form1" name="mmpid" type="text" size="10" MAXLENGTH="7" value=""> ?</h4>
</th>
</tr>
<br>
<tr>
<th width=" 90" valign="top">
<h4>
Description:
</h4>
</th>
<th align="left">
<h4>
<textarea id="form1" name="description" cols="90" rows="15"></textarea>
</h4>
</th>
</tr>
<tr>
<th width=" 90">
<h4>
File:
</h4>
</th>
<th align="left">
<h4><input type="hidden" name="MAX_FILE_SIZE" value="5242880">
<input id="form1" type="file" name="f_file" size="40">?
</h4>
</th>
</tr>
<tr>
<th width=" 90">
<h4>
Mapimage:
</h4>
</th>
<th align="left">
<h4>
<input id="form1" type="file" name="f_image" size="40">?
</h4>
</th>
</tr>
<tr>
<th width="90">
<h4>
<input id="form1" type="submit" value="GO!">
</h4>
</th>
</tr>
</table>
form2.php
<?
require("conf.php");
$mapname=$_POST['mapname'];
$description=$_POST['description'];
$date = date("d-m-y; H:i"); $accept = 0;
$mmpid = $_POST['mmpid'];
$snightmode = $_POST['nmid'];
$query = "INSERT INTO smaplist set mapname='$mapname',description='$description',date='$date',accept='$accept',mmpid='$mmpid',snightmode='$snightmode'";
if($query) echo "Rekord został dodany poprawnie"; else echo "Błąd nie udało się dodać nowego rekordu";
?>