简体   繁体   中英

How can I send a date from one site to other sites?

I'm not much of a php coder, mainly use VB. But I had a problem with one of my apps. To make it more secure I would need each php parameter to go through one site. Here is an example of what I mean:

  • Application loads
  • Sends ip and location to 2 servers (a.php & b.php)

The problem so far is that the PC is making direct connections to these pages. What I was trying to do is make it so that it only sends one command to z.php and the page z.php would send the data to a.php and b.php .

My question is: How would I set up z.php ?

I hope this makes sense; I have looked everywhere and couldn't find an answer.

You can have z.php make a GET request to a.php and b.php, passing the required parameters in the querystring.

ieaphp?parama=valuea&paramb=valueb

You can then grab these from $_GET in a.php and b.php

Is this what you are trying to do?

This cab be achieve using cURL function in PHP...see the below references..

http://php.net/manual/en/book.curl.php
http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html

You'll have to write your z.php file to perform connection to a.php and b.php. You can retreive IP and location though $GET variable, an example would be :

  • You call z.php?ip=xxx.xxx.xxx.xxx&location=yyyy
  • z.php makes an HTTP request (you can use cURL for that)
  • z.php waits for the response and send it back to your original script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM