I’m trying to “post” some data to a php script. Of the 3 variables being sent, only the first one seems to be getting sent. What am I not seeing here?
<script type="text/javascript">
$(document).ready(function(){
$("#newproject").ajaxForm({
url: '/ajax/newproject.php',
type: 'post',
data: 'name=' + $('name').val() + '&username=<?php echo $_SESSION['username']; ?>&sessionid=<?php echo $_SESSION['id']; ?>',
success: function(data) {
if (data == 'success') $('#returnMessage').attr('class', 'good');
else $('#returnMessage').attr('class', 'bad');
$('#returnMessage').html(data);
}
});
});
</script>
Try to use Array data:
You can retrieve post data using $_POST[‘name’], $_POST[‘username’], etc.