49
rated 0 times
[
51]
[
2]
/ answers: 1 / hits: 48935
/ 11 Years ago, sat, september 7, 2013, 12:00:00
How can i add php content or php variable inside Java-script alert box?!
I tried to make it work few ways but it is only popping up a blank box rather than the contents of php variable.
Here is the code:
<script language=javascript>
$(document).ready(function() {
$(#a).blur(function() {
<?php $b = $_POST['a'];
if(isset($_POST['update'])) {
mysql_query(UPDATE tbl_travel set fld_a='.$_POST[$b].' where fld_id = '.$_POST[id].' ) or die(mysql_error());
} ?>
alert (<?php $b ?>);
});
});
</script>
Thank You for your Help :)
More From » php