[eluser]Unknown[/eluser]
Hi,
On an AJAX callback to the client I would like to send basic markup. This markup currently has some PHP in it but I need to first read this content from a file, parse it with PHP and then send it back to the client using an echo.
Is this the best way to do this or is there a better cleaner simpler way?
Code:
// The method that handles the AJAX call.
public function showContents(){
$contents = file_get_contents('../path/myloginForm');
eval($contents);
echo $contents;
}
-------------------------------------------
MARKUP
<link rel="stylesheet" type="text/css" href="<?php base_url().'application/components/dhtmlxForm/dhtmlxForm/codebase/skins/dhtmlxform_dhx_skyblue.css'?>">
[removed][removed]
[removed][removed]
[removed]
formStructure = [
{type:"settings",position:"label-top"},
{type: "fieldset",name:"calculator", label: "Calculator", list:[
{type: "input", name: 'firstNum', label: 'First number:'},
{type:"input", name:"secNum", label:"Second number:"},
{type:"input", name:"resNum", label:"Result:"},
{type:"newcolumn"},
{type:"button", name:"plus", width:20,offsetTop:2, value:"+"},
{type:"button", name:"minus",width:20,offsetTop:10, value:"-"},
{type:"button", name:"multiply",width:20,offsetTop:10, value:"*"},
{type:"button", name:"divide",width:20,offsetTop:10, value:"/"}
]}
];
var myForm = new dhtmlXForm("form_container",formStructure);
[removed]
<div id="form_container">/div>