Jump to content
php.lv forumi

Kā noņemt tagus?


Dooling

Recommended Posts

Man nesanāk aizvietot tagus ar atstarpi :(

Lūk mans kods

$serv = "localhost";
$user = "turists";
$pass = "";
$db = "BDA";
$table="monitori";

mysql_connect($serv,  $user, $pass);
$cr="CREATE DATABASE ".$db."";
mysql_query($cr);
mysql_select_db($db);

$result="CREATE TABLE ".$table." (nosaukums VARCHAR(100), razotajs TEXT, serija VARCHAR(25), modelis VARCHAR(25) , iz_gads VARCHAR(4), statuss varchar(20), comment varchar(100))";

mysql_query($result);
echo "<FORM METHOD=POST ACTION=monitor_reg.php name=new>";
include('forma.sig');

if($_POST['up'] == 'Labi') 
str_replace("<b>"," ",$_POST['nosaukums']);
str_replace("<u>"," ",$_POST['nosaukums']);
str_replace("<i>"," ",$_POST['nosaukums']);
str_replace("</b>"," ",$_POST['nosaukums']);
str_replace("</u>"," ",$_POST['nosaukums']);
str_replace("</i>"," ",$_POST['nosaukums']);

if(isset($_POST['up']) && ($_POST['up']=='Labi')) 
{
$i = "insert into ".$table."   values('{$_POST['nosaukums']}','{$_POST['razotajs']}','{$_POST['serija']}','{$_POST['modelis']}','{$_POST['iz_gads']}','{$_POST['statuss']}','{$_POST['comment']}')"; 
mysql_query($i);
mysql_close();

 

forma.inc

 

<TR>
<TD>Nosaukums</TD>
<TD><INPUT TYPE='text' NAME='nosaukums'></TD>
</TR><TR>
<TD>Ražotājfirma</TD>
<TD><INPUT TYPE='text'  NAME='razotajs'></TD>
</TR><TR>
<TD>Sērijas numurs</TD>
<TD><INPUT TYPE='text'  NAME='serija' ></TD>
</TR><TR>
<TD>Modeļa numurs</TD>
<TD><INPUT TYPE='text' NAME='modelis'></TD>
</TR><TR>
<TD>Izgatavošanas datums </TD>
<TD>SELECT NAME='iz_gads'>
<option selected>GGGG</option>
   <option>2002</option>
   <option>2003</option>
   <option>2004</option>
</SELECT></TD>
</TR><TR>
<TD>Statuss</TD>
<TD><SELECT NAME='statuss'>
<option selected >---</option>
<option>remontā</option>
</SELECT</TD>
</TR><TR>
<TD>Komentāri</TD>
<TD><TEXTAREA NAME='comment' ROWS='' COLS=''></TEXTAREA></TD>
</TR></TABLE>
<INPUT TYPE='submit' name='up' value='Labi' >
<INPUT TYPE='reset' value='Dzēst'> 
</Form>

 

Es vēlos, lai datu bāzē ieraksti būtu bez tagiem. Kā, lai to paveic? Paldies jau iepriekš

Link to comment
Share on other sites

×
×
  • Create New...