Skip to main content

Posts

Showing posts from February, 2012

T_ENCAPSED_AND_WHITESPACE

PHP Parse error:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE! Tired of this error, the solution is: the value which you are trying to get from $_POST or from web browser to server are getting in using single quotes and you are trying to access them using double quotes or vice versa! example On Jquery client side: $('#submit_transaction').live('click',function(){ $.ajax({ url: '../abcd/addTransactionview.php', type: "POST", data:{ created : $('date').val(), amount : $('amount').val(), merchant : $('merchant').val(), authToken : $.cookie("authToken") }, success: function(data) { $('#preview').html(''); $('#preview').html(data); } }); }); On Server side: $authToken = $_POST("authToken"); $created = $_POST('created'); $amount = $_POST('amount'); $merchant = $_POST('merchant');