ziedinjsh Posted July 22, 2011 Report Share Posted July 22, 2011 informācijas ievadīšanas kods $uid = mysql_real_escape_string($_POST['uid']); $author = mysql_real_escape_string($_POST['author']); $title = mysql_real_escape_string($_POST['title']); $link = mysql_real_escape_string($POST['link']); $date = date("Y:h:i y.m.d"); $statuss = "ok"; if(empty($author) || empty($title) || empty($link)){ $error = "<div class='i-error'>Kads no lauciņiem ir palicis tukš!</div>"; $statuss = "error"; } if($statuss<>"ok"){ echo $error; }else{ mysql_query("INSERT INTO songs (uid, author, title, link, date) VALUES ('$uid', '$author', '$title', '$link', '$date')") or die(musql_error()); echo "<div class='i-ok'>Dziesma pievienota!</div>"; } kad atstāj kādu lauciņu tukšu viņš rād erroru ka kāds lauciņš ir tukš.. tā ir jābūt, bet to pašu viņš rāda arī tad kad visi lauciņi ir aizpildīti!! kapēc tā!? Link to comment Share on other sites More sharing options...
briedis Posted July 22, 2011 Report Share Posted July 22, 2011 Ieslēdz kļūdu parādīšanos un tad tu sapratīsi kur ir vaina. Ieliec šito koda sākumā: ini_set("display_errors", true); error_reporting(E_ALL); Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 22, 2011 Author Report Share Posted July 22, 2011 ieliku, bet vienalga rāda vnk erroru Kāds no lauciņiem ir tukš! Link to comment Share on other sites More sharing options...
briedis Posted July 22, 2011 Report Share Posted July 22, 2011 Mikijs bik izgāzās :D ziedinjsh, acīmredzot neieslēdzi gan to kļūdu parādīšanos, tāpēc, ka ja būtu, tad uzreiz izlektu Notice ar kļūdaino vietu. Link to comment Share on other sites More sharing options...
daGrevis Posted July 22, 2011 Report Share Posted July 22, 2011 var_dump(). Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 22, 2011 Author Report Share Posted July 22, 2011 var_dump(). array 'author' => string 'D7' (length=2) 'title' => string 'Human Source' (length=12) 'link' => string '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F19551233"></param>'>http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F19551233"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F19551233" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="http://soundcloud.com/gatisziedins/d7-human-source">D7 -'... (length=594) 'uid' => string '1' (length=1) 'addmusic' => string 'Pievienot dziesmu' (length=17) Link to comment Share on other sites More sharing options...
Val Posted July 22, 2011 Report Share Posted July 22, 2011 $POST['link'] Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 22, 2011 Author Report Share Posted July 22, 2011 Mikijs bik izgāzās :D ziedinjsh, acīmredzot neieslēdzi gan to kļūdu parādīšanos, tāpēc, ka ja būtu, tad uzreiz izlektu Notice ar kļūdaino vietu. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); include("../misc/dbase.php"); $uid = mysql_real_escape_string($_POST['uid']); $author = mysql_real_escape_string($_POST['author']); $title = mysql_real_escape_string($_POST['title']); $link = mysql_real_escape_string($POST['link']); $date = date("d.m.y"); $statuss = "ok"; var_dump($_POST); if(empty($author) || empty($title) || empty($link)){ $error = "<div class='i-error'>Kads no lauciņiem ir palicis tukš!</div>"; $statuss = "error"; } if($statuss<>"ok"){ echo $error; }else{ mysql_query("INSERT INTO songs (uid, author, title, link, date) VALUES ('$uid', '$author', '$title', '$link', '$date')") or die(musql_error()); echo "<div class='i-ok'>Dziesma pievienota!</div>"; } ?> Link to comment Share on other sites More sharing options...
daGrevis Posted July 22, 2011 Report Share Posted July 22, 2011 $POST['link'] Bravo! Link to comment Share on other sites More sharing options...
Maris-S Posted July 22, 2011 Report Share Posted July 22, 2011 Ja Tu patiešām ieslēdzi kļūdu paziņojumus, ko Briedis teica, tad viennozīmīgi redzēsi kaut ko tādu: Notice: Undefined variable: POST in ........ Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 22, 2011 Author Report Share Posted July 22, 2011 upss.. laikam jāpārstāj uz kādu brīdi skatīties tai monitorā Link to comment Share on other sites More sharing options...
Recommended Posts