We have a script that pulls data from a secure site and puts it into a dropdown box for us to select, and from there it parses information into something readable. Recently that dropdown box no longer appears. The site admin of the host site said Google recently forced HTTPS, so I changed that in our code to reflect it pulling from a secure site now.
So basically the processes is as follows: User logs into our site Goes to Upload page, site prompts for the host site's user/pass Enter user/pass, screen comes up that is supposed to show dropdown after login has been authenticated. Note that I can follow the $url and login normally to it.
My question is, is there anything else I'd have to change when going from nonsecure to secure? I've included the relevant code (I believe).
<?php
require_once("/public_html/jumi_src/event_logs/admin_functions.php");
if (isset($_POST["username"]) && !empty($_POST["password"]) && !isset($_POST["event_type"]))
{
$username = $_POST["username"];
$password = $_POST["password"];
$url = "secure site here";
$f1 = 'loginid'; // Name of field1(ON THE WEBSITE YOU'RE TRYING TO LOGIN ON!)
$f2 = 'password'; // Name of field2(ON THE WEBSITE YOU'RE TRYING TO LOGIN ON!)
$v1 = $username; // Value of field1(FROM THE WEBSITE YOU'RE TRYING TO LOGIN FROM!)
$v2 = $password; // Value of field2(FROM THE WEBSITE YOU'RE TRYING TO LOGIN FROM!)
//$find = 'Welcome to your account'; // String to search for in the page you've logged in on
$postchars = http_build_query( array($f1 => $v1, $f2 => $v2) );
$stream = stream_context_create( array('http' => array('method' => 'POST', 'header' => 'Content-Type: application/x-www-form-urlencoded', 'content' => htmlspecialchars_decode( $postchars ) ) ) ); // Creates an array of the sourcecode, and inputs the values of the field1 and field2
$fh = file_get_contents($url, false, $stream); //for troubleshooting.
//REALLY NEEDS A HANDLER FOR WHEN $FH DOESN"T COME BACK FOR SOME REASON.
//printf("Login wasn't completed. No file was retreived. Please check your password at the htc CM login page to verify that it's good. If it is there is a systme issue. Please let Nefarious know.");
//FOR TROUBLESHOOTING
// printf("<textarea rows='100' cols='100'>");
// printf($fh);
// printf("</textarea>");
//getting the dropdown box returned from THC to select a scenario to upload
$a = strpos($fh, "<SELECT NAME");
$b = strpos($fh, "</SELECT>");
$c = strlen($fh) - $b;
$e = substr($fh, $a, -$c);