Jump to content

Blank field, then data field :/


dennismonsewicz

Recommended Posts

if(move_uploaded_file)
					{
						include "includes/sql.php";

						$query = "insert into uploads (username, name, size, type, url, categories, downloaded_by) " . "values ('$uploaded_by', '$filename', '$filesize', '$filetype', '$url', '$categories', '')";

						mysql_query($query) or die("ERROR: " . mysql_error());

						echo '<p>File loaded into Database successfully!</p>';
					} else {
						echo '<p>There was a problem with inserting the file into the database! Please try again!</p>';
						} 
				} else {
						echo '<div class="maincontentheader">
										<h2>' . ucwords($_SESSION['username']) . ', use the form below to upload an image!</h2>
									</div>

									<p>Make sure to add categories to this image.</p>
									<p> </p>
									<p>Adding categories allows for the image to show up during an image search!</p>
									<p> </p>
									<p>Example Categories: Cat, Dog, Ocean, Older Male, Female, etc...</p>
									<p> </p>
									<p style="font-size: 80%"><b>Note: if you have more than one category please make sure to separate them by a comma!</b></p>
									<p> </p>

									<!-- The data encoding type, enctype, MUST be specified as below -->
									<form enctype="multipart/form-data" action="upload.php?username=' . $_SESSION['username'] . '" method="POST" name="uploadfile">
										<!-- MAX_FILE_SIZE must precede the file input field -->
										<input type="hidden" name="MAX_FILE_SIZE" value="9999999" />
										<!-- Name of input element determines name in $_FILES array -->
										<p>Image Categories: <input name="categories" type="text" /></p>
										<p> </p>
										<p>Upload this file: <input name="userfile" type="file" /></p>
										<p><input type="submit" value="Upload File" /></p>
									</form>';
								}

					//On-the-fly thumbnail generator
					include "thumbtest.php";

					$thumbq = mysql_query("insert into thumbs (thumb_name) " . "values ('$filename')");

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.