FT3 Posted January 23, 2010 Report Share Posted January 23, 2010 Labdien , ta tada lieta vai jus varetu pateikt kodu kurš parbauda vai ir aizpilditi title, text, autor, date lauki iepriekš paldies ! <?php require("connect.php"); $title = $_POST[title]; $text= $_POST[text]; $autor = $_POST[autor]; $date = $_POST[date]; mysql_query ("INSERT INTO news (title, text, autor, date) VALUES ('$title','$text','$autor','$date')") or die(mysql_error()); echo "Zina ir veiksmigi pievienota !"; ?> Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted January 23, 2010 Report Share Posted January 23, 2010 Reku baigais kods: http://uk3.php.net/empty Quote Link to comment Share on other sites More sharing options...
FT3 Posted January 23, 2010 Author Report Share Posted January 23, 2010 nja nezini , nedot tizlus linkus. Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted January 23, 2010 Report Share Posted January 23, 2010 (edited) Nu ja tu pat nepaskatījies, kas tur ir tad nu neko darīt... P.S. SQL Injection FTW!!! EDIT: reku vēlviens mega kods btw: http://uk3.php.net/manual/en/control-structures.if.php Edited January 23, 2010 by rATRIJS Quote Link to comment Share on other sites More sharing options...
false Posted January 23, 2010 Report Share Posted January 23, 2010 <? if(!empty($_POST['title'])){ $title = $_POST[title]; $text= $_POST[text]; $autor = $_POST[autor]; $date = $_POST[date]; mysql_query ("INSERT INTO news (title, text, autor, date) VALUES ('$title','$text','$autor','$date')") or die(mysql_error()); }else{echo"aizpildi visus laukus!";} ?> Quote Link to comment Share on other sites More sharing options...
2easy Posted January 23, 2010 Report Share Posted January 23, 2010 es arī iedošu vienu tizlu linku http://php.net/manual/en/function.mysql-real-escape-string.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.