Faks Posted March 23, 2011 Share Posted March 23, 2011 My problem could be odd if say it but i will spill it out, only don't say I am mad completely jut a bit ! 1.when comment is first in whole news if i press edit appear html form but if i am trying to submit any information it returns to comments and don't update ! 2.if there were more than one comment in news if i press edit appear html forms 1.not working | 2.working and do updates | 3.were appear but is gone but not sure does bug will return also not working ! Sample how it looks ! This is indeed odd hope somebody has knowledge in such issues or at least a cure for such severe bug website http://hostings.flush.ws/ user guest password guest11 | to test bug :'( go to the news comments and spam as much needed ! Link to edit code echo "<a href='/?section=nwcomment&id=".$id."&comment=edit&id_edit=".$row_news_comment['hosting_comment_id']."'>Edit Comment</a>"; Update code as far i know it is correct at least i do hope sow (also this code is inside while cycle ) if ($_GET['comment'] == 'edit') { $comment_id_edit = (INT)$_GET['id_edit']; $comment_text = $row_news_comment['hosting_comment_text']; $edit_comment_text = $_POST['hosting_comment_text']; if(isset($_POST['hosting_comment_text'])) { mysql_query("UPDATE hosting_comment SET hosting_comment_text = '".$edit_comment_text."' WHERE hosting_comment_id = '".$comment_id_edit."' ") or die (mysql_error()); } if (isset($_POST['Submit'])) { echo "<meta http-equiv='REFRESH' content='0;url=/?section=nwcomment&id=".$id."'>"; } echo ("<form action='/?section=nwcomment&id=".$id."&comment=edit&id_edit=".$comment_id_edit."'' id='edit_comment' name='edit_comment' method='post'> <p> <textarea name='hosting_comment_text' cols='50' rows='10' id='textarea' value='$edit_comment_text' ></textarea> <p> <input type='submit' name='Submit' id='button' value='{$lang['BODY_NEWS_COMMENT_SUBMIT']}' /> <input type='reset' name='Reset' id='button' value='{$lang['BODY_NEWS_COMMENT_RESET']}' /> </p> </form>"); } if is needed more complete code just ask i will publish it (i hope to fix bug as soon possible grand opening of registration will be on the Aprils Fools Day) Quote Link to comment Share on other sites More sharing options...
btherl Posted March 23, 2011 Share Posted March 23, 2011 Try adding statements like this: print "About to do query<br>"; So you can see which code is executed. In the code you pasted, I would add a print inside every "if" Quote Link to comment Share on other sites More sharing options...
Faks Posted March 24, 2011 Author Share Posted March 24, 2011 odd but i tested and both form's use same query's and they execute but still 1. form not working but 2.works no Mather how odd it sounds if wish to test it check it on website but i am still wondering what could cause such issues :'( is there anybody who knows how to fix the bug Quote Link to comment Share on other sites More sharing options...
Faks Posted March 25, 2011 Author Share Posted March 25, 2011 bump ! Quote Link to comment Share on other sites More sharing options...
btherl Posted March 28, 2011 Share Posted March 28, 2011 All I can suggest is- add print statements everywhere: print "About to check GET[comment]<br>"; if ($_GET['comment'] == 'edit') { print "GET[comment] = edit<br>"; $comment_id_edit = (INT)$_GET['id_edit']; $comment_text = $row_news_comment['hosting_comment_text']; $edit_comment_text = $_POST['hosting_comment_text']; print "About to check POST[hosting_comment_text]<br>"; if(isset($_POST['hosting_comment_text'])) { print "POST[hosting_comment_text] is set<br>"; mysql_query("UPDATE hosting_comment SET hosting_comment_text = '".$edit_comment_text."' WHERE hosting_comment_id = '".$comment_id_edit."' ") or die (mysql_error()); } if (isset($_POST['Submit'])) { echo "<meta http-equiv='REFRESH' content='0;url=/?section=nwcomment&id=".$id."'>"; } echo ("<form action='/?section=nwcomment&id=".$id."&comment=edit&id_edit=".$comment_id_edit."'' id='edit_comment' name='edit_comment' method='post'> <p> <textarea name='hosting_comment_text' cols='50' rows='10' id='textarea' value='$edit_comment_text' ></textarea> <p> <input type='submit' name='Submit' id='button' value='{$lang['BODY_NEWS_COMMENT_SUBMIT']}' /> <input type='reset' name='Reset' id='button' value='{$lang['BODY_NEWS_COMMENT_RESET']}' /> </p> </form>"); } I have added 4 prints above. Keep adding more until you see where the problem is. 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.