Cleaned file and updated connection details

Added check to ensure $url is defined before attempting cURL
Cleaned if statements to remove { and } that are not needed.
Added dropdown with http/https dropdown to solve curl malformed url.