Processing This form

Hi there Please can anyone help me out with the following. I have this html file called loggedin.html where users have to upload a photo, a logo and designs but the photo and logo need only be uploaded once thereafter, the user can upload as many designs as possible. I need a script to process this form as explained above and store in a database. Here is the file

<form method="post" action="loggedin.php" enctype="multipart/form-data" >
							<div>
								<label for="uploadPhoto">Upload Photograph:</label>
								<input type="file" name="uploadPhoto"  id="upload"/>
							</div>
							<div>
								<label for="uploadLogo">Upload Logo:</label>
								<input type="file" name="uploadLogo"  id="upload"/>
							</div>
							<div>
								<label for="uploadDesigns">Upload Designs:</label>
								<input type="file" name="uploadDesigns"  id="upload"/>
							</div>
							<!--
								I do not need you at the moment:
								<div>
									<label for="imgType">Image Type:</label>
									<input type="radio" name="imageType" id="logo" value="logo" />Logo
									<input type="radio" name="imageType" id="photo" value="photo" />Photo
									<input type="radio" name="imageType" id="design" value="design" />Design
								</div>
							-->
							<div>
								<label for="brandID">Brand Identity:</label>
								<textarea name="brandID" rows="4" cols="40" id="brandID"></textarea>
							</div>
							<div>
								<label for="history">Please tell us about yourself:</label>
								<textarea name="history" rows="20" cols="40" id="history"></textarea>
							</div>
						
							<div>
								<input type="submit" name="btnSubmit" id="btnSubmit" value="Submit" />
							</div>
							<div>
								<input type="hidden" name="submitted" value="TRUE" />
							</div>
							
							
					</form>

The database tables are as follows:


CREATE TABLE user (
    	userID MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
    	fname VARCHAR(20) NOT NULL,
	lname VARCHAR(20) NOT NULL,
	email VARCHAR(80) NOT NULL,
	category VARCHAR(40) NOT NULL,
	membership VARCHAR(20) NOT NULL,
	location VARCHAR(80) NOT NULL,
	username VARCHAR(30) NOT NULL,
    	password CHAR(40) NOT NULL,
	reg_date DATETIME NOT NULL,
	PRIMARY KEY (userID),
	UNIQUE(username),
	INDEX(password, username),
	UNIQUE(email)
) ENGINE=INNODB;

CREATE TABLE logo (
	userID MEDIUMINT UNSIGNED NOT NULL,
	logoID INT NOT NULL  AUTO_INCREMENT,
	filename VARCHAR(255) NOT NULL,
   	mimetype VARCHAR(50) NOT NULL,
   	description VARCHAR(255) NOT NULL,
         filedata MEDIUMBLOB,
	brandIdentity LONGTEXT NOT NULL,
	history LONGTEXT NOT NULL,
	PRIMARY KEY (logoID),
	FOREIGN KEY (userID) REFERENCES user(userID)
) ENGINE=INNODB;

CREATE TABLE design (
	userID MEDIUMINT UNSIGNED NOT NULL,
	dID INT NOT NULL  AUTO_INCREMENT,
	cat VARCHAR(40) NOT NULL,
	filename VARCHAR(255) NOT NULL,
   	mimetype VARCHAR(50) NOT NULL,
   	description VARCHAR(255) NOT NULL,
   	filedata MEDIUMBLOB,
	PRIMARY KEY (dID),
	FOREIGN KEY (userID) REFERENCES user(userID)
) ENGINE=INNODB;

Thanks

will it cater to my requirement?
Thanks

It’ll give you lots of tutorials, where you can learn how to write such a script. And surely there’ll also be some scripts too :slight_smile:

The problem I have is that, I do not just want to upload files. If you look at my code, I also have other form inputs that need to be validated.

I basically want three uploads along with the other form inputs submitted. Then in next thing will only be to upload designs as many times as possible.

:frowning: