Right now I'm just trying to figure out the basics and print out a string from a PHP function called when a radio button is clicked but I can't get anything back from the php function (I've even tried to just print directly form the php function). Here's the code:
Code: Select all
<?
// Begin session
session_start();
function showProg2($selection)
{
$str="HELLO";
print("<div>hello</div>");
return $str;
}
// sajax
require("sajax.php");
$sajax_request_type = "POST";
sajax_init();
//$sajax_debug_mode = 1;
sajax_export("showProg2");
sajax_handle_client_request();
?>
<html>
<head>
<script type="text/javascript">
<?
sajax_show_javascript();
?>
function showProg(theform)
{
var prog_select=document.forms[0];
var prog_val=prog_select.elements[0].value;
var prog_str=x_showProg2(prog_val);
document.getElementById("prog").innerHTML+="this:"+prog_str;
}
</script>
</head>
<body>
<div id='main' class='big'>
<table cellpadding='3px' border='1px'>
<form name='select_opt' id='select_opt' >
<tr><td>
<input name='select_radio' id='select_radio' type='radio' value='1' onClick="showProg(this)">
Intensive</input>
</td></tr><tr><td>
<input name='select_radio' id='select_radio' type='radio' value='2' onClick='showProg(this)'>
Ethos</input>
</td></tr><tr><td>
<input name='select_radio' id='select_radio' type='radio' value='3' onClick='showProg(this)'>
Origins</input>
</td></tr></table></form>
</div>
<div id='prog' class='big'>
</div>
</body>
</html>http://www.nxivm.com/ben/ajax/admin_main.php
Any help at all is greatly appreciated!
Thanks.