I can't find a simple way to do this :S. If I use AJAX I will need to use a div within HTML, but it's important that ONLY the contents of $response is displayed within the source code?
Could someone point me into what PHP functions I should be using ? Thank you!
So what is the solution to your problem?
In order of preference:
You shouldn't be suing any functions :P
However, while it is a seemingly horrible way to do a validation, you could do the following:
- Use fopen to open a URL with your parameters in the URL that will be picked up by the js function.
- Have your PHP function parse the HTML file (that you used fopen to get) for output and search for the specific output you want.
Really though, you should just do the validation in the PHP script itself. Much safer, much easier and much easier to work with later if you want to change something.