Jump to content


Photo

Please help me with this Programming Exercise for school.


  • Please log in to reply
4 replies to this topic

#1 stayblack

stayblack
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 May 2006 - 01:32 PM

Hey, I have this programming exercise for school. I dont think it is too difficult, the problem is, ist has to be completely in OOP, and I have never done anyOOP PHP in my life. Ok here it goes:


Step 01:

Create a HTML/PHP Webform to upload files. The files should be stored in a temporary Directory on the Server. The directory should be able to be defined by an administrator.

The File should be checked if it is in binary- or text-format. Binary Files aren't allowed, and if one attemtps to upload them, they should get an error message.


Step 02:

List the lines of the Textfile in Input Fields. a One Line Input Field for each line of text. The User should be able to edit the data in the Input fields, before they are imported into the database via a buttonclick. The Lines should belong to an entry of that textfile.

Step 03:

After the Import, display the textlines out of the imported File. The Lines should be generated out of the database.

This Procedure of Uploading, Editing, Importing and Displaying should be able to be done more than once. Please keep that in Mind when designing your database. The Combination of Line and File should always be recognizable, and as an added Information the time and date of the Import.



Other Rules:

- please document your classes and functions
- Use the template Engine [a href=\"http://smarty.php.net\" target=\"_blank\"]http://smarty.php.net[/a]
- Javascript based plausibility checks arent allowed
- Please use PHP version 4 and MySQL version 4.1
- The Script should be easy to install for anybody, therefore all required parameters should be stored in a seperate config file
- Create Classes for: Database Access, Input checking, File Handling, PHP Input Parameters Handling($_REQUEST cannot be used in the actual Program File, only in the class)
- please send us the SQL Statements for creation of the database tables







Please help me, I dont expect someone to code the entire thing for me, but at least a roadmap please.

thanks

#2 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 27 May 2006 - 01:52 PM

Have you written ANY part of this yet to show us?

No offense, but the road map is already there, ie....

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Step 01:
A. Create a HTML/PHP Webform to upload files.
(1) do you know how to create a very simple html form?
(2) do you know how to get the information from the form?
(3) do you know how to modify the form to accept file uploading?

B. The files should be stored in a temporary Directory on the Server.
(1) do you know how to have php create a folder/directory?

C. The File should be checked if it is in binary- or text-format. Binary Files
aren't allowed, and if one attemtps to upload them, they should get an
error message.
(1) do you know how to check a files's type?
[/quote]

do it in small increments. each one being as self contained as possible.

Keep us posted.

Lite...

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

#3 stayblack

stayblack
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 May 2006 - 02:02 PM

[!--quoteo(post=377556:date=May 27 2006, 08:52 AM:name=litebearer)--][div class=\'quotetop\']QUOTE(litebearer @ May 27 2006, 08:52 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Have you written ANY part of this yet to show us?

No offense, but the road map is already there, ie....
do it in small increments. each one being as self contained as possible.

Keep us posted.

Lite...
[/quote]

Hey Lite,

Yes I know how to do all of that. Well Actually, checking if it is binary or text could be a small problem, but I'm guessing its checkable via the $_FILE array. However I am having problems with doing it in OOP.

#4 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 27 May 2006 - 02:14 PM

hmmm..

have you read this? and if so do you have specific questions?

[a href=\"http://www.phpfreaks.com/tutorials/48/0.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/48/0.php[/a]

Lite...

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

#5 stayblack

stayblack
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 May 2006 - 03:11 PM

Thanks for that link Lite, I am reading it right now.

To be more clear on the type of help I am looking for, since I just read over my post and it seemed like I just wanted someone to code it for me:

Some resources on OOP PHP besides the one posted by Lite, and maybe a tutorial on how object oriented programs are built. Ever read the book "Build your own Database Driven Website with PHP and MySQL" ? Thats the book that helped me learn PHP in the first place. He gave a little theory of PHP and mySQL in the beginning, and then jumped straight into applying it to real situations. Thats the type of material I need to really understand programming concepts.

There is no doubt that I could learn this on my own given enough time, but I got the assignment on friday and it has to be done by monday.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users