PHP / CURL / JSON / AJAX / HTML - can not retrieve what i need -


I have server1 and server. I will post data from server 2 to server 1 to fill the form I need. And submit the user without redirecting to server 1, and after submitting the form I need that PHP be executed from server 1 and submitting form will result in return to server2.

Maybe

Server to PHP: Prefix = $ url_base $ Url_param = 'name =' $ _USER ['name'] '& Amp; Email = '$ _USER [' email ']' & amp; Phone = '$ _USER [' phone ']' & Amp; Country = '$ _USER [' country ']. '& Amp; Password = '$ _USER [' password ']' & Amp; Verify_code = '' - '' & Amp; Group = '1' & Amp; Lever = '100' & Amp; Deposit = '10000' & Amp; State = '' - '' & Amp; Zipcode = '' - '' and city = '' - '& amp; Phone_password = '' - '' & Amp; Send_report = '' - '' & Amp; Register_demo = 'yes_register'; $ Ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, $ url_base); Curl_setopt ($ CH, CURLOPT_FOLLOWLOCATION, 0); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ ch, CURLOPT_TIMEOUT, 30); Curl_setopt ($ CH, CURLOPT_POST, 1); Curl_setopt ($ CH, CURLOPT_POSTFIELDS, $ url_param); Curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ('content-type: application / jason', 'content-length:'. Strlen ($ url_param)); $ Result = curl_xac ($ CH); Curl_close ($ ch);

My code is sending data from Server 2 to Server 1 and completing the form and displaying HTML as a $ result, but I need Form 2 For server 1 after being credited to the server, I need that the PPP of the form will be executed from server 1 and the result of the form will be sent back, in fact after the form is submitted it results in a login for the user And password will have been built after the login and password submitted.

I am sending an extra parameter to this & amp; Register_demo = 'yes_register'; When Form 1 is completed by the server, then 2 files in my form is a file for the front file and the second one for the back-end because I use AJAX.

If I make no mistake, after fixing the form from Form2 server to 1 server, I get cured, but it seems that PHP is not executed on server 1, that I return the login and password Can i And I try to get this parameter '& amp; Register_demo = 'yes_register'; Not doing anything like this, it appears that the form is only present and not going to the back-end file.

Please be very appreciative for any help, this situation is going crazy to me. > I came out of this solution because the form can only be deposited with an IP, and for that reason I have the same form on the other server, I need to somehow submit Form 2 to the server And get the login and password from the server 2 to display it in the user.

Thank you in advance.

based

I will describe the solution given below, and if anyone I need help if I need help.

Solution:

Using AJX due to my form, I am sending the curl from server 2 to server 1 to complete Form 2 and after receiving the results PHP will be executed on 1 server. My PHP was not executed because of AJAX.

So I have created an API that Server 2 will consume it. I have implemented a form and all the PHP in a separate file that I need to execute (plane PHP). After that I was sending the colon to the API I did and executing PHP and returning the desired results.

If someone needs more help in this matter, please contact me and I can help, or I can insert a code sample based on your request.

Thanks guys for the right signal.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -