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 l开发者_运维知识库ocation 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.
i.e. a.php?parama=valuea¶mb=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.
精彩评论