Hi ive set up 2 scripts, both communicating back and forth.
One thing id like is for 1 script to post an unknown amount of GETs to the other script.
Id like the other script to some how be able to grab all the GETS and put the values in an array.
Hi ive set up 2 scripts, both communicating back and forth.
One thing id like is for 1 script to post an unknown amount of GETs to the other script.
Id like the other script to some how be able to grab all the GETS and put the values in an array.
If you simply want to make GET requests from one script to another, put something like
file_get_contents( "http://www.yoursite.com/script_2.php?some_var=some_value" );
And then, in script_2.php just read the variable
$_GET['some_var'];
$_GET already is an array. No reason you can't just copy it into your another array whose name is easier to type.
$array = $_GET;
If I understand you correctly you want to post your some GET data received by script_1.php from script_1.php to script_2.php,right?If so ,this probably can help you
<?php
/*@file script_1.php*/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'url_of_script_2.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_GET);
curl_exec($ch);
?>
And in script_2.php,you will get the GET datas by using $_POST
.See curl in manual