[jQuery] Re: How PHP script can return two variables ?

2009-01-30 Thread GreatBigBore
Have your PHP script return an XML document: PHP: /* FunctionResult FunctionStatus success=1 message=Request processed / /FunctionResult */ $document = DOMImplementation::createDocument(); $document-formatOutput = true;

[jQuery] Re: How PHP script can return two variables ?

2009-01-30 Thread Nguyễn Quốc Vinh
Very simple! Please use JSON to return JSON string! With JSON, we can return value easier than XML! With XML, you must echo correct tag=)) 2009/1/31 GreatBigBore robfbis...@mac.com: Have your PHP script return an XML document: PHP: /* FunctionResult

[jQuery] Re: How PHP script can return two variables ?

2009-01-30 Thread GreatBigBore
Have your PHP script return an XML document, and then parse that XML with JQuery: PHP: /* FunctionResult FunctionStatus success=1 message=Request processed / /FunctionResult */ $document = DOMImplementation::createDocument();

[jQuery] Re: How PHP script can return two variables ?

2009-01-30 Thread Eric Garside
That XML is a lot of unnecessary work. If you're running with PHP5, simply print on success: echo json_encode(array('success' = true, message = '')); or on failure: echo json_encode(array('success' = false, message = '')); And for the jQuery bit: $.post('somurl.php', function (data){ if

[jQuery] Re: How PHP script can return two variables ?

2009-01-30 Thread James
I prefer this JSON method also. Just remember to define the dataType as JSON! I've made mistakes many time of forgetting that and keep wondering why my JSON objects are always undefined. On Jan 30, 10:01 am, Eric Garside gars...@gmail.com wrote: That XML is a lot of unnecessary work. If you're