I am trying to do a calculation.
In html this is my script to take the data to the php class
function estimatedbill() {
var objJSON = {
seconds: seconds,
}
$.post('calculations.php', objJSON ).error(function() {
console.log("this is the calculations part and it didn''t send it to calculations.php");
}).success(function(data) {
console.log("data gathered");
//here output the result back
$("p").text(data);
console.log(seconds);
});
}
But in the php, i was thinking to make a class with different functions and pass the seconds value along to do different calculations with it. SO far I have this (below) but im not sure what to do next bcause when i place the echo inside the function i get this whole papragraph error. If you could just guide me on hwo to start i'd appreciate it
<?php
$seconds=$_POST["seconds"];
echo "it echoed ". $seconds;
function billestimation($seconds){
}
?>

New Topic/Question
Reply


MultiQuote


|