The code snippet for the jQuery function looks like:
function addMessage() {
if (textval != "") {
text_string='<div class="alert-box round"><p class="text-left">' + userName + ':' + textval + '</p></div></br>';
alert(text_string);
$.ajax({
type:"POST",
url:"process.php",
data: {'text_string': text_string},
cache:false,
success:function(){
alert("submitted")
}
});
$("input[type=text]:last").val("");
}
enterButton = 0;
}
The process.php code looks like:
<body>
<?php
//$host = "localhost";
$text_string=$_POST['text_string'];
echo "string submitted is".$text_string;
?>
</body>
I get alerts showing value of text_string and then the "submitted", but when I open the php page, it shows an error:
Undefined index: text_string
I've seen various answers, none of them seem to be the case for mine. Is the problem in PHP code or jQuery code or both?
Such as: var foo = function (a, b) { return a + b; }; var bar = function (a, b) { return a * b; }; var fn = _.compose([foo, bar]); How to understand the fn?
Such as: var foo = function (a, b) { return a + b; }; var bar = function (a, b) { return a * b; }; var fn = _.compose([foo, bar]); How to understand the fn?
I have a string that is used to display text. It is initially set to null, then is updated throughout a function with status updates. I want to make sure the string is set to the correct status ...
I have a string that is used to display text. It is initially set to null, then is updated throughout a function with status updates. I want to make sure the string is set to the correct status ...
I want to make something like Inspect Element highlight. I want to add a border to divs on mouseover. I don't want this to change the width of the div and also, there are some divs with their own ...
I want to make something like Inspect Element highlight. I want to add a border to divs on mouseover. I don't want this to change the width of the div and also, there are some divs with their own ...
<html> <input type="file" name="Image"> </html> <script> fabric.Image.fromURL('image.jpg', function(img) {enter code here var oImg = img.set({ left: 50, top: 100, angle: 00 })....
<html> <input type="file" name="Image"> </html> <script> fabric.Image.fromURL('image.jpg', function(img) {enter code here var oImg = img.set({ left: 50, top: 100, angle: 00 })....