php - validate data from url without api -


Hello Stack Overlay Fellow,

I am trying to create a PHP based forum for CA . I want the forum to be exclusive to CA Now, on the sign-up page, their membership number will be asked. This membership number should be valid from the other URL. Now, the problem is that the second site does not provide an API for it, and someone has to manually enter the membership number and submit the subscription details.

The site's URL can check where a status is: http://220.225.242.179/locm.asp

Sample membership number: 4066 9 < / P>

The site uses post data so no logic can be passed through the URL.

Can it be automated anyway? Or do I need to accept all the registrations manually?

You can create a script that scraps the contents of that link. The problem is that if you update the website, then you have to maintain that script.

There is no CAPTCHA or mechanism to prevent automatic capture in this form, you can set up a few simple steps.

You can use the curl of the post request:

  // set the post variable $ url = 'http://220.225.242.179/locm.asp'; $ Fields = array ('mrn' = & gt; "406691",); // URL- ify for POST foreach data ($ field as $ key = & gt; $ value) {$ fields_string = $ Key '='. $ Value '& Amp;'; } Rtrim ($ fields_string, '& amp;'); // open connection $ ch = curl_init (); // set url, number of post wars, post data curl_setopt ($ ch, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_POST, Count ($ fields)); Curl_setopt ($ CH, CURLOPT_POSTFIELDS, $ fields_string); // execute post $ result = curl_exec ($ ch); // close connection curl_close ($ ch);  

Take a look at the following links:


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -