Jump to content

php mysql update html form bugs or issues


Faks

Recommended Posts

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  :P !

 

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 !

ia59d2353csmiesbpqxj_thumb.jpg

 

This is indeed odd hope somebody has knowledge in such issues or at least a cure for such severe bug  :confused:

 

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)

Link to comment
Share on other sites

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  :'(  :shrug:

is there anybody who knows how to fix the bug  :wtf:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.