Wamp Server and PHP


#1

I just installed Wamp Server to test on localhost so I can locally test Ajax POSTs to PHP scripts. These scripts use the Print command to return req.responseText to the app. However, it sends a bunch of html code preceding what is in the Print statement. This works properly from my Host domain, it gets just what it should without the extra html. I’m new to Wamp Server so there is probably an incorrect setting in PHP. Anyone know why the extra html code?

But this brings up another question: is Print or Echo the best way to return server side data to the app? I can use readFile to read the same data from a file on the server. Is this a better way to get the req.responseText?

Thanks, John


#2

Use JSON. It’s sent in text format and you can then parse out the data you want to use or display.
This link may help:
http://wiki.nsbasic.com/GetJSON


#3

The format of the data is not the issue. It’s the method used to get the data. I’ve always used the PHP Print command, but maybe an Ajax read would be a better method. Just thinking out loud.

Thanks, John


#4

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.