vitao.web Posted June 12, 2010 Report Share Posted June 12, 2010 Seit ir viss kods Notice: Undefined index: news_title in C:\AppServ\www\point\svs\add_news.php on line 9 Notice: Undefined index: news_message in C:\AppServ\www\point\svs\add_news.php on line 10 Notice: Undefined index: news_category in C:\AppServ\www\point\svs\add_news.php on line 11 Bet man ir tak nodifinets vai ari tomer ne? Paldies! vitao.web Quote Link to comment Share on other sites More sharing options...
waplet Posted June 12, 2010 Report Share Posted June 12, 2010 ar isset vajag parbaudīt.. ja nav padots news_title, tad $variablis it kānevar būt izveidots. Quote Link to comment Share on other sites More sharing options...
vitao.web Posted June 12, 2010 Author Report Share Posted June 12, 2010 Protams neesmu specuks, bet vai tad es to seit neizdaru? if (!ISSET ($_POST['news_title'])) { Quote Link to comment Share on other sites More sharing options...
waplet Posted June 12, 2010 Report Share Posted June 12, 2010 $n_title = mysql_real_escape_string($_POST['news_title']); vajag $n_title = isset($_POST['news_title']) ? mysql_real_escape_string($_POST['news_title']) : NULL; Quote Link to comment Share on other sites More sharing options...
vitao.web Posted June 12, 2010 Author Report Share Posted June 12, 2010 $n_title = isset($_POST['news_title']) ? mysql_real_escape_string($_POST['news_title']) : NULL; Šo izmantojot itkā pazūd tie errori, kad nav nodifinēti $variabli, bet nekas nepievienojas iekša DB Quote Link to comment Share on other sites More sharing options...
waplet Posted June 12, 2010 Report Share Posted June 12, 2010 tāir 9-tā rindiņā, nevis tālāk. Quote Link to comment Share on other sites More sharing options...
vitao.web Posted June 12, 2010 Author Report Share Posted June 12, 2010 tāir 9-tā rindiņā, nevis tālāk. visus $variablus apzimeju pec tas parauga...bet nepievienojas db nekas :( Quote Link to comment Share on other sites More sharing options...
mickys Posted June 13, 2010 Report Share Posted June 13, 2010 (edited) 9-12 rinda (ieskaitot) jāpārnes uz else { if(empty($_POST['news_title']) || empty($_POST['news_message']) || empty($_POST['news_category'])) { echo "<p>You did not fill in all the fields,"; echo "please try again</p>\n"; } else { /////////////Šejieni $query = "INSERT Edited June 13, 2010 by mickys Quote Link to comment Share on other sites More sharing options...
Kemito Posted June 13, 2010 Report Share Posted June 13, 2010 Ja erroru nav, un nekas neievietojas DB tad drošvien vaig paklausīt mickey :) kļūda varbūt arī ir saskatāma tevis veidotajā vaicājumā! Quote Link to comment Share on other sites More sharing options...
Maaren Posted June 13, 2010 Report Share Posted June 13, 2010 Nu tak mācies atrast kurā vietā tev ir kļūda. Pēc 38 rindas "} else {" ieraksti echo 'test'; parādas? tad ej tālāk pēc 44 rindas. Parādas testa ziņojumi? Tad pēc query izpildes raksti mysql_error(); 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.