PHP and Sajax

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
littlecoder
Forum Commoner
Posts: 26
Joined: Fri Oct 17, 2008 4:36 am

PHP and Sajax

Post by littlecoder »

Hi ,
i used the Sajax library.But an error occurs : 'object expected'. Can anyone help ?
The code is as shown below :
<?
require("Sajax.php");

function multiply($x, $y) {
return $x * $y;
}

sajax_init();
// $sajax_debug_mode = 1;
sajax_export("multiply");
sajax_handle_client_request();

?>
<html>
<head>
<title>Multiplier</title>
<script>
<?
sajax_show_javascript();
?>

function do_multiply_cb(z) {
document.getElementById("z").value = z;
}

function do_multiply() {
// get the folder name
var x, y;

x = document.getElementById("x").value;
y = document.getElementById("y").value;
x_multiply(x, y, do_multiply_cb);
}
</script>

</head>
<body>
<input type="text" name="x" id="x" value="2" size="3">
*
<input type="text" name="y" id="y" value="3" size="3">
=
<input type="text" name="z" id="z" value="" size="3">
<input type="button" name="check" value="Calculate"
onclick="do_multiply(); return false;">
</body>
</html>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP and Sajax

Post by requinix »

Post the HTML of your page.
littlecoder
Forum Commoner
Posts: 26
Joined: Fri Oct 17, 2008 4:36 am

Re: PHP and Sajax

Post by littlecoder »

Hi,
But the button is of type 'button' and not 'Submit' . So i doubt whether POST will help ?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP and Sajax

Post by requinix »

littlecoder wrote:Hi,
But the button is of type 'button' and not 'Submit' . So i doubt whether POST will help ?
:? Really? Really?
post, v:
16a. to send (a message) to a newsgroup.
As defined here.
Post Reply