SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

    Code HTML4Strict:
    <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:
    Code MySQL:
    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

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    will it cater to my requirement?
    Thanks

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    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

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    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
    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.

    :-(


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •