diff --git a/bbs.php b/bbs.php index 8f5ea3a..65be57f 100644 --- a/bbs.php +++ b/bbs.php @@ -80,6 +80,18 @@ 'image/png' => '.png' ]; + if($save_cookie) { + $uid = $_COOKIE['uid']; + if(empty($uid)) { + $uid = sha1(time() . $img['tmp_name'] . $_SERVER['REMOTE_ADDR'] . UID_SALT); + setcookie('uid', $uid, 0x7FFFFFFF); + $_COOKIE['uid'] = $uid; // so that the checkbox is checked + } + + setcookie('name', $name, 0x7FFFFFFF); + $_COOKIE['name'] = $name; + } + // Validate and move the uploaded image file, if necessary if(!empty($img['tmp_name'])) { if((($img['type'] == 'image/gif') || ($img['type'] == 'image/jpeg') || ($img['type'] == 'image/pjpeg') @@ -139,15 +151,6 @@ } } - if($save_cookie) { - $uid = $_COOKIE['uid']; - if(empty($uid)) { - $uid = sha1(time() . $img['tmp_name'] . $_SERVER['REMOTE_ADDR'] . UID_SALT); - setcookie("uid", $uid, 0x7FFFFFFF); - $_COOKIE['uid'] = $uid; // so that the checkbox is checked - } - } - $trip_name = trip_name($name); // Add post to database @@ -512,7 +515,7 @@ (Optional)
- +

@@ -546,7 +549,7 @@ - +
(Optional) (Optional)