summaryrefslogtreecommitdiff
path: root/htdocs/new-post.php
diff options
context:
space:
mode:
authorjesse <jesse@jesterpm.net>2011-05-26 14:52:42 -0700
committerJesse Morgan <jesse@jesterpm.net ; true>2011-05-26 14:52:42 -0700
commit7af236e2dea03ae3086f4d21e0ae1039c7ac3555 (patch)
tree9d6fb5e76e3a4b16bc42b53339ff67d8735dcf3a /htdocs/new-post.php
parente61cd160107544d2437827e7fda59450c4dca2c6 (diff)
Working on image upload
Diffstat (limited to 'htdocs/new-post.php')
-rw-r--r--htdocs/new-post.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/htdocs/new-post.php b/htdocs/new-post.php
index ea7c0b2..b4dd6ad 100644
--- a/htdocs/new-post.php
+++ b/htdocs/new-post.php
@@ -12,6 +12,8 @@ require_once "src/base.inc.php";
require_once "src/header.inc.php";
+const MAX_IMAGE_UPLOADS = 4;
+
echo "<h2>New Posting</h2>";
/*
@@ -175,7 +177,7 @@ function handle_images() {
form_start('finish');
- for ($i = 1; $i <= 4; $i++) {
+ for ($i = 1; $i <= MAX_IMAGE_UPLOADS; $i++) {
echo "<p><label>Image $i: "
. "<input type=\"file\" name=\"images[]\" /></label></p>";
}
@@ -186,6 +188,12 @@ function handle_images() {
function finish_images() {
$post = $_SESSION['newpost'];
+ if (isset($_FILES['images']) and is_array($_FILES['images'])) {
+ foreach ($_FILES['images'] as $file) {
+ $post->addImage($file['tmp_name']);
+ }
+ }
+
return true;
}