Does anybody have any idea why the following code does not execute correctly. I want the fields in the form to be checked for content on submission but the if condition is just passed even when there isn’t any content held in the fields. I’m confused:
[php]<?php
include ‘initialize.php’;
if (!(isset($_SESSION[‘user_id’])&& $_SESSION[‘user_id’]!=’’))//if the following is false- session not been assigned a valid user value/is blank then…
{
header(‘Location:index.php’);
end();
}
include ‘template/top.php’;
?>
Create Folder
<?php if (isset($_POST['folder_name'], $_POST['folder _description'])) { $folder_name = $_POST['folder_name']; $folder_description = $_POST['folder_description']; if (empty($folder_name) || empty($folder_description)) { echo 'Folder name and description required'; } else { create_folder($folder_name, $folder_description); header('Location: uploads.php'); exit(); } } ?>Name:
Description:
[/php]
any help will be much appreciated…thanks