Jump to content
Posted 06 February 2017 - 02:54 PM
Posted 08 March 2017 - 07:28 AM
Your issue is probably because the "longer" url is an external URL and your shorter URL is an internal one. Your security settings in PHP might be messing with your code. Just use cURL.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
Edited by newage, 08 March 2017 - 07:51 AM.
Posted 08 June 2017 - 10:11 AM
PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.
0 members, 0 guests, 0 anonymous users