Hi Everyone, This seems to be a simple question. But I am new to JSON and I am working with PHP. I have my json formatted string which i need to pass to gain access to an API but I do not want this in the URL bar... I then need to dynamically manipulate that url to pass other data. My question is, if i have a URL: www.example.com?username=something&password=somethingelse how can I call that url to load my information when my page loads with index.php?
This is very simple to do within P H P via cURL. Here is something i wrote up real quick for you. $c = curl_init('http://www.example.com/index.php'); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_USERAGENT, "A useragent here" ); curl_setopt($c, CURLOPT_POST, 1); curl_setopt($c, CURLOPT_POSTFIELDS, "username=something&password=somethingelse"); $output = curl_exec($c); Code (markup): You can then use the following code the echo the output: echo $output Code (markup): I hope that helps