Dooling Posted March 30, 2005 Report Share Posted March 30, 2005 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 More sharing options...
bubu Posted March 30, 2005 Report Share Posted March 30, 2005 Cilvēk! Tu pirms ko jautāt vispār manuālī esi skatījies? http://lv.php.net/manual/en/function.str-replace.php un pievērs uzmanību šai rindai (īpaši pirmajiem 5 vārdiem): This function returns a string or an array with all occurrences of search in subject replaced with the given replace value. Link to comment Share on other sites More sharing options...
Venom Posted March 30, 2005 Report Share Posted March 30, 2005 un ja es rakstīšu <B> ? vai <b >, koa? sk. strip_tags() Link to comment Share on other sites More sharing options...
Dooling Posted March 30, 2005 Author Report Share Posted March 30, 2005 thx Venom funkcija strip_tags() man derēja noņemot tagus un kādu Jūs man funkciju ieteiktu izmantot, lai nebūtu <b >,< b>? Link to comment Share on other sites More sharing options...
Venom Posted March 30, 2005 Report Share Posted March 30, 2005 to pašu strip_tags() sākotnēji, tālāk ar regulārām izteiksmēm, but don't go there yet Link to comment Share on other sites More sharing options...
Recommended Posts