1
0
mirror of https://github.com/Chouchen/shorturl.git synced 2018-06-07 06:34:38 +02:00

Added logging (for debugging)

This commit is contained in:
Chouchen 2011-01-04 10:19:25 +00:00
parent 1dc9fa898a
commit a8186f4852

View File

@ -3,9 +3,13 @@ session_start();
include 'class/ShortURL.php';
$url = new ShortURL();
$log = new Log('shorting.log');
$newname = $_POST['shortName'];
$newURL = $_POST['url'];
$log->message('entering '.$newname.' as '.$newURL);
$_SESSION['msg'] = '';
if($newname =='' || $newURL==''){
$_SESSION['msg'] .= ShortURL::STATE_FIELD_MISSING;
@ -26,7 +30,12 @@ else{
$folder = '/'.$folders[1].'/';
}else
$folder = '/';
$log->message('folder : '.$folder);
$_SESSION['msg'] .= 'Raccourci cr&eacute;&eacute; : <a href="http://'.$_SERVER['SERVER_NAME'].$folder.rawurlencode($newname).'">http://'.$_SERVER['SERVER_NAME'].$folder.rawurlencode($newname).'</a>';
$log->message('that makes the link : http://'.$_SERVER['SERVER_NAME'].$folder.rawurlencode($newname).'"');
}
header('Location: '.$folder);