Hi folks,
I'm producing a form for my hosting site which will (hopefully) log users directly into cPanel on their account, but I'm having some difficulty with the script which handles the form submission.
Whenever I test it it just shows me the cPanel login for the domain being submitted, it doesn't log in.
Would anyone mind having a look at it?
Thanks in advanceCode:<?php // using $_GET to test sending the variables, the final form will use $_POST for obvious reasons if($_GET == TRUE) { $vars = array( 'domain' => $_GET['d'], 'user' => $_GET['u'], 'pass' => $_GET['p'], ); } else { echo "no vars"; exit; } // the rest of this is the redirect $curlHandler = curl_init(); $curlOpts = array( CURLOPT_URL => "https://".$vars['domain'].":2083/login/", CURLOPT_FRESH_CONNECT => true, CURLOPT_HEADER => false, CURLOPT_POSTFIELDS => http_build_query($vars, "", "&"), CURLOPT_RETURNTRANSFER => true, CURLOPT_USERAGENT => "SHcPanelReDirect/0.1" ); curl_setopt_array($curlHandler, $curlOpts); if(false === ($responseString = curl_exec($curlHandler))) { exit("0 - No connection to server."); } echo $responseString; ?>
Cheers,
Robert


LinkBack URL
About LinkBacks

Reply With Quote