[eluser]A.M.F[/eluser]
hello mates
i want to make an add-comments-form with jQuery.
therefore i writed this JS:
Code:
$(document).ready(function() {
$("#commentF").submit(function () { return false; });
$("#comment input[@type='submit']").click(function(){
$.post("<?=site_url_rel("show/comment/".$game_id)?>", {content: $("textarea").val()}, function(xml) {
var content = $("textarea").val();
$("#comment").html(
"התגובה התווספה בהצלחה"
);
});
});
});
now, this is my html:
Code:
<div id="comment" style="display:block; float:right; width:30%; margin-right:15px;">
<h1>הוספת תגובה</h1><br />
<form id="commentF" method="post">
<br /><textarea name="content" maxlength="300" class="big_txt" value="sdf">עברית</textarea>
<br /><input type="submit" name="send" value=" שלח תגובה " />
</form>
</div>
and that the php code inside my controller:
Code:
function comment($item_id)
{
header('Content-Type: text/html; charset=windows-1255');
$comment = $this->input->post('content', TRUE);
//if (trim($comment) == "") show_error("עלייך לכתוב תגובה ישמוק");
$data = array('cmnt_itemid' => $item_id,
'cmnt_item' => 'game',
'cmnt_content' => $comment,
'cmnt_date' => 'היום'
);
$this->db->insert('comments', $data);
return true;
}
everything is ok, BUT- the $comment data that i get is in japanease or whatever, even though i added a header with my encoding. why is that?
thank u guys