Daney11 Posted December 5, 2007 Share Posted December 5, 2007 Hey guys, this is starting to get on my nerves now.. Bascially i have a submit form. Im doing everything right to submit my data.. well at least i think i am. Snipplets of code <input type="text" name="comment_coverageid" value="<?php echo $coverage_id ?>"><textarea name="comment_body" rows="6" cols="55" onclick=javascript:storeCaret(this); onchange=javascript:storeCaret(this); onselect=javascript:storeCaret(this); value="<?php if (isset($_POST['comment_body'])) echo $_POST['comment_body']; ?>"></textarea> `coverage_id` displays a number, which works fine. `comment_body` you have to input your comment. Now for the submitting. $query = "INSERT INTO `coverage_comments` ( comment_id, comment_teamid, comment_coverageid, comment_date, comment_author, comment_body )"; $query .= " VALUES ( 'NULL', '$team_url', '$coverage_id', NOW(), '".$HTTP_SESSION_VARS['valid_user']."', '$comment_body' )"; Everything but `coverage_id` submits perfectly, but i dont understand why when the form shows the number inside the box, everything is named how it should be :S Very confusing. Any ideas guys? Thanks Quote Link to comment Share on other sites More sharing options...
revraz Posted December 5, 2007 Share Posted December 5, 2007 Try writing the name instead name="comment_coverageid" Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted December 5, 2007 Share Posted December 5, 2007 First off, <TEXTAREA> doesn't accept a VALUE attribute.. change it to this: <input type="text" name="comment_coverageid" value="<?php echo $coverage_id ?>"><textarea name="comment_body" rows="6" cols="55" onclick=javascript:storeCaret(this); onchange=javascript:storeCaret(this); onselect=javascript:storeCaret(this);><?php if (isset($_POST['comment_body'])) echo $_POST['comment_body']; ?></textarea> And for the other, try echoing coverage_id by itself and see what it shows Quote Link to comment Share on other sites More sharing options...
dolcezza Posted December 5, 2007 Share Posted December 5, 2007 I am new 2 but could the underscore be the problem? comment_coverageid, coverage_id Quote Link to comment Share on other sites More sharing options...
Daney11 Posted December 5, 2007 Author Share Posted December 5, 2007 Wesf90, ive changed the textarea bit. When i eco coverage_by itself it shows my what the coverag_id is. Wether it be 1,2,3 etc. But it just doesnt submit into the database but everthing else does :S Quote Link to comment Share on other sites More sharing options...
Daney11 Posted December 5, 2007 Author Share Posted December 5, 2007 I am new 2 but could the underscore be the problem? comment_coverageid, coverage_id Nah its not the underscore mate, thanks anyways Quote Link to comment Share on other sites More sharing options...
revraz Posted December 5, 2007 Share Posted December 5, 2007 No, you are writing the wrong variable unless you have a setting like $coverage_id = $_POST['comment_coverageid']; somewhere Quote Link to comment Share on other sites More sharing options...
Daney11 Posted December 5, 2007 Author Share Posted December 5, 2007 No, you are writing the wrong variable unless you have a setting like $coverage_id = $_POST['comment_coverageid']; somewhere Worked, thankyou very much <3 Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted December 5, 2007 Share Posted December 5, 2007 [edit].. nevermind.. fixed 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.