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:
parent
1dc9fa898a
commit
a8186f4852
@ -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éé : <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);
|
||||
|
Loading…
Reference in New Issue
Block a user