5 Replies - 2450 Views - Last Post: 29 September 2012 - 05:19 PM Rate Topic: -----

#1 ssfox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 25-September 12

How to create simple online submission systems using php or mysql?

Posted 27 September 2012 - 09:16 AM

Hello, I'm designing my own website, I want to create online assignment submission system which allows to students to upload their assignment through this webpage,and receive feedback immediately via the browser.The teacher can recieve student documents and grade the student for his assignment.

Since Im working on my localhost(XAMMP), let say now Im the student and teacher(Admin) at same time because the work will done in my localhose.

so far I just was able to upload file using this php code.

<form action="upload.php" enctype="multipart/form-data" method="post">
    <p>
    Type some text (if you like):<br>
<input type="text" name="textline" size="30">
   </p>
<p>
Please specify a file, or a set of files:<br>
<input type="file" name="file" id = " file" size="40">
</p>
<div>
<input type="submit" id ="u_button" name = "u_button" value="Send">
</div>
</form>

I know this code simple for uploading file . I have to code " upload.php" inorder to send the uploaded file to my server(XAMMP), How can this be done? and How can I create in my database online submission system for student and teacher that I described above.

Is This A Good Question/Topic? 0
  • +

Replies To: How to create simple online submission systems using php or mysql?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9366
  • View blog
  • Posts: 35,187
  • Joined: 12-June 08

Re: How to create simple online submission systems using php or mysql?

Posted 27 September 2012 - 09:30 AM

Quote

,and receive feedback immediately via the browser.

Immediate what? Confirmation the file was received? A grade? Partial credit? A funny lolcat picture?

Quote

How can this be done? and How can I create in my database online submission system

Well think about it.. what do you need to track? You need a log in system so that's what - a user name and password? Then some sort of role tracking so you know who is a student and who is a teacher. Probably an email address, class they are in, real name, etc. Oh.. then you'll need a table for classes (times, days, subjects, etc).. and a relational table of classes_to_people. Then a table to track where the files were stored on the server and tie that to a user id. Then some way to track grades for projects... and at that point might as well tabulate other grades as well, right?

Quote

for student and teacher that I described above

You haven't really described much.. so clarification!
Was This Post Helpful? 0
  • +
  • -

#3 ssfox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 25-September 12

Re: How to create simple online submission systems using php or mysql?

Posted 27 September 2012 - 10:37 AM

for ",and receive feedback immediately via the browser." I ment yes either confirmation that file has assignment file has uploaded and feedback on grade on same browser after uploading done.

I already done with registration and login, but My question is How to implement this submission system so as student I can upload and sent my assignment to server(phpmyadmin) and as teacher I can check tht file has uploaded or mark that assignment.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9366
  • View blog
  • Posts: 35,187
  • Joined: 12-June 08

Re: How to create simple online submission systems using php or mysql?

Posted 27 September 2012 - 10:55 AM

Upload scripts are pretty common.

http://www.w3schools...file_upload.asp
Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5363
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: How to create simple online submission systems using php or mysql?

Posted 27 September 2012 - 11:02 AM

View Postssfox, on 27 September 2012 - 12:16 PM, said:

let say now Im the student and teacher(Admin) at same time because the work will done in my localhose.

I'm not helping with any work done in your local hose.

It cracks me up anytime someone asks for help creating a 'simple' whatever. Just because your skill set is lower doesn't mean advanced topics can be dumbed down. Anything advanced requires a basic to intermediate skill set of that language, period.

View Postssfox, on 27 September 2012 - 01:37 PM, said:

My question is How to implement this submission system so as student I can upload and sent my assignment to server(phpmyadmin) and as teacher I can check tht file has uploaded or mark that assignment.

Use a database value defaulted to zero for uploaded. Upon upload that value because not zero. Then your code issues an sql for anything zero (not uploaded) or not zero (uploaded) for the different displays.

Or you could use an uploaded time stamp entry in the database, & anything without a time stamp (00:00:00) will represent that project has not been uploaded. Anything with a timestamp obviously has been uploaded.
Was This Post Helpful? 2
  • +
  • -

#6 ssfox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 25-September 12

Re: How to create simple online submission systems using php or mysql?

Posted 29 September 2012 - 05:19 PM

Thnak's no2pencil for advice. I came up with following code.

<form enctype="multipart/form-data" action="upload.php" method="POST">
 Please choose a file: <input name="uploaded" type="file" /><br />
 <input type="submit" value="Upload" />
 </form>


the following is for upload.php :
<?php 
 $target = "upload/"; 
 $target = $target . basename( $_FILES['uploaded']['name']) ; 
 $ok=1; 
 if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
 {
 echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
 } 
 else {
 echo "Sorry, there was a problem uploading your file.";
 }
 ?>

so,now how can I make move_uploaded_file()to place uploaded file goes to my server (phpmyadmin) and u mentioned how something about time stamp how can that added to this code? and file my final question is tht I would like to limit my uploaded file by java Extension only ( .java), but not sure the following code is correct or not ?
if (!($uploaded_type=="text/.java")) {
echo "You may only upload Java files.<br>";
$ok=0;
}
any help would be appreciated??
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1