Hey folks,
I'm trying to create a form for my website where users are able to short their URL's using one out of many different services. The form shall be like that: First a drop down menu to choose a service, then a text field to enter the long URL and then a "GO!" or "CUT IT!" button. I have already the API code for U.NU, so I just need the form coding but to let PHP handle that form. But how?
Here the PHP API code from U.NU:
PHP Code:
$original_url = 'http://www.vareside.com/';
$request = 'http://u.nu/unu-api-simple?url=' . urlencode($original_url);
$response = file_get_contents($request);
if (substr($request, 0, 4) == 'http')
{
echo "Shortened URL = $response";
}
else
{
list ($error_code, $error_message) = explode('|', $response);
echo "Error = $error_message ($error_code)";
}
I hope someone can help me as fast as possible.
Thanks to all of you!