I'm new to the whole concept of using AJAX in my PHP scripts and I have stone-walled.
What I am looking to do is this;
Once the page loads, my AJAX script will start to send data to my server so that it can verify the data, after it recieves a response from my server of either a "0" or a "1", it then goes on to send another request to my server and wait for a response, it'll carry on doing this until theres no more data to verify.
The data that the script will send to my server will probably be generated by PHP and look something similar to this;
My problem is this -
I have no knowledge of AJAX, I have absolutely no clue how to do what I proposed, but without it, my script will never work.
Here's how the page will work;
PHP generates all the variables
AJAX 'locates' those variables and begins to parse them one by one, sending the data to my PHP script using AJAX using the GET type, my server will respond to AJAX and produce a number of either 1 or 0 (I can code all the PHP aspects of this)
After AJAX recieves the response from my server, it'll do some javascript code to start changing divs and whatnot (I can also do this).
My issue is the AJAX. I've probably repeated myself and missed out key information, if I have please tell me and I'll try fix it.
All help/suggestions are appreciated, I've been searching all over the place for two days and requesting help with this is my last resort.
What I am looking to do is this;
Once the page loads, my AJAX script will start to send data to my server so that it can verify the data, after it recieves a response from my server of either a "0" or a "1", it then goes on to send another request to my server and wait for a response, it'll carry on doing this until theres no more data to verify.
The data that the script will send to my server will probably be generated by PHP and look something similar to this;
Code:
var request1=new Array("127.0.0.1", "80");
var request2=new Array("127.0.0.1", "80");
var request3=new Array("127.0.0.1", "80");
I have no knowledge of AJAX, I have absolutely no clue how to do what I proposed, but without it, my script will never work.
Here's how the page will work;
PHP generates all the variables
AJAX 'locates' those variables and begins to parse them one by one, sending the data to my PHP script using AJAX using the GET type, my server will respond to AJAX and produce a number of either 1 or 0 (I can code all the PHP aspects of this)
After AJAX recieves the response from my server, it'll do some javascript code to start changing divs and whatnot (I can also do this).
My issue is the AJAX. I've probably repeated myself and missed out key information, if I have please tell me and I'll try fix it.
All help/suggestions are appreciated, I've been searching all over the place for two days and requesting help with this is my last resort.
Comment