PHP Contest Series 2011 – Challenge #2

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 5017 Views - Last Post: 16 March 2011 - 09:48 PM

#1 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4227
  • View blog
  • Posts: 13,399
  • Joined: 08-June 10

PHP Contest Series 2011 – Challenge #2

Post icon  Posted 15 February 2011 - 04:16 AM

Welcome to the second PHP Competition!

we’re back with a brand new challenge from Dogstopper.

The Challege - Dynamic websites

This first part is worth 30 points.
1) Design and develop a MySQL (or other type) database that holds all the information about a page. The PHP will query for the information and construct a page based on that data. So, design this as if you are designing a tutorials site. You will have a single PHP page that accepts a GET parameter specifying which tutorial you want.

For example: www.example.com/tutorial.php?tutorialid=x

Where x is a valid tutorial id. Your program should take that ID and render a page if it is valid or give a page not found result if it wasn't found. The better that your program can handle problems, the better.

The tutorial page should contain the following information (minimum), but if you add extra things to it (such as tutorial groups like PHP tuorials, Java tutorials...), it will score extra design points:
1. Title - should be in the browser title and as the page header.
2. Text - This should include markup that is parsed to create the page (like headers and paragraphs)

However, other things may get you more points based on the inginuity that you come up with.

This next part is worth 15 points.
2) On top of the tutorial rendering system, write an administrative backend that allows you to add/edit/remove tutorials so that you do not have to directly manipulate the database each time.

This next part is worth 5 points.
3) Add a links page where each link is also generated from the database. When you add a tutorial, the links page should change as well because they are pulling the data from the same source.

timeframe
Part 1 is due on March 21st 12:00 GMT. Parts 2/3 have to be handed in until March 31st 23:59 GMT.

requirements
- no mysql_*() functions!
- documentation
- allowed frameworks: CodeIgniter, CakePHP, Symfony, Yii, APF. Mind that work done by the framework may not count for your score points (depending on what that work is).
- preferred databases: MySQL, SQLite (Dormilich also has PostgreSQL)

OOP is not a requirement.

Hope you enjoy!

© PHP腕比べ遠征開発計画組

This post has been edited by Dormilich: 15 February 2011 - 04:54 AM


Is This A Good Question/Topic? 1
  • +

Replies To: PHP Contest Series 2011 – Challenge #2

#2 Jstall   User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: PHP Contest Series 2011 – Challenge #2

Posted 15 February 2011 - 10:08 AM

Second one already? I'm still putting the finishing touches on the first one :D.

Now when you say the database should hold all the information about the page does that include all it's content as well? Such as the actual body of the tutorial?

Also, getting some PHP challanges out there rock, I love it! :D

I learned a few new tricks doing the first one and it will definitely change the way I design some of my classes in the future, I'm sure this one will be just as good.
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4227
  • View blog
  • Posts: 13,399
  • Joined: 08-June 10

Re: PHP Contest Series 2011 – Challenge #2

Posted 15 February 2011 - 11:35 AM

View PostJstall, on 15 February 2011 - 06:08 PM, said:

Second one already? I'm still putting the finishing touches on the first one :D.

100 $ want to be earned …

View PostJstall, on 15 February 2011 - 06:08 PM, said:

Now when you say the database should hold all the information about the page does that include all it's content as well? Such as the actual body of the tutorial?

what else would you put in the DB?
Was This Post Helpful? 0
  • +
  • -

#4 Jstall   User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: PHP Contest Series 2011 – Challenge #2

Posted 15 February 2011 - 12:59 PM

Right, of course, I don't know what I was thinking there.

One more question, forgive my noobishness here but would we want to put actual markup in the database as well? Could you suggest any links(or Google terms) where I could read up on this practice?

Forgive me, just not 100% sure what the requirements are. I have a good idea of how I am going to do this but want to be sure I am doing it correctly. Thanks much.
Was This Post Helpful? 0
  • +
  • -

#5 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4227
  • View blog
  • Posts: 13,399
  • Joined: 08-June 10

Re: PHP Contest Series 2011 – Challenge #2

Posted 15 February 2011 - 01:06 PM

View PostJstall, on 15 February 2011 - 08:59 PM, said:

but would we want to put actual markup in the database as well?

that’s up to you to decide.

View PostJstall, on 15 February 2011 - 08:59 PM, said:

Forgive me, just not 100% sure what the requirements are.

the requirements are listed in the first post and the Contest Thread.

View PostJstall, on 15 February 2011 - 08:59 PM, said:

I have a good idea of how I am going to do this but want to be sure I am doing it correctly.

if you have a good idea, then use it. we don’t punish you for choosing a path we didn’t think of as long as the path is good.
Was This Post Helpful? 1
  • +
  • -

#6 Guest_Jmyeom*


Reputation:

Re: PHP Contest Series 2011 – Challenge #2

Posted 17 February 2011 - 03:37 AM

where do we submit the code to, i have a code that can be turned into that, but its a bit more complex then what it needs to be,

can i still use my code if it was not built for that purpose?
Was This Post Helpful? 0

#7 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4227
  • View blog
  • Posts: 13,399
  • Joined: 08-June 10

Re: PHP Contest Series 2011 – Challenge #2

Posted 17 February 2011 - 03:42 AM

1) see Contest Thread

2) you can use your code as long as it solves the task. (it’s not as if it not your code at all, is it?)
Was This Post Helpful? 0
  • +
  • -

#8 creativecoding   User is offline

  • Hash != Encryption
  • member icon


Reputation: 931
  • View blog
  • Posts: 3,216
  • Joined: 19-January 10

Re: PHP Contest Series 2011 – Challenge #2

Posted 24 February 2011 - 12:19 AM

Quote

- no mysql_*() functions!


Is there any other way to connect to a mysql database?

Also, we won't be scored on the style of the webpage right? I don't really like to tinker with CSS for 2 hours...
Was This Post Helpful? 0
  • +
  • -

#9 Dogstopper   User is offline

  • The Ninjaducky
  • member icon

Reputation: 2972
  • View blog
  • Posts: 11,223
  • Joined: 15-July 08

Re: PHP Contest Series 2011 – Challenge #2

Posted 24 February 2011 - 04:18 AM

Why don't you use the mysqli object. Much safer and (from what I read), newer.

View Postcreativecoding, on 24 February 2011 - 02:19 AM, said:

Also, we won't be scored on the style of the webpage right? I don't really like to tinker with CSS for 2 hours...


No. It's a PHP contest, not a CSS contest.
Was This Post Helpful? 0
  • +
  • -

#10 creativecoding   User is offline

  • Hash != Encryption
  • member icon


Reputation: 931
  • View blog
  • Posts: 3,216
  • Joined: 19-January 10

Re: PHP Contest Series 2011 – Challenge #2

Posted 24 February 2011 - 05:58 PM

Awesome, thanks.
Was This Post Helpful? 0
  • +
  • -

#11 ProgrammerZach   User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 12
  • Joined: 23-July 09

Re: PHP Contest Series 2011 – Challenge #2

Posted 27 February 2011 - 02:43 PM

What do you mean by no mysql_* functions?

Like... we can't use mysql_query?
Was This Post Helpful? 0
  • +
  • -

#12 Valek   User is offline

  • The Real Skynet
  • member icon

Reputation: 544
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: PHP Contest Series 2011 – Challenge #2

Posted 27 February 2011 - 03:26 PM

That is exactly correct. Alternatives are PDO (recommended) and MySQLi.
Was This Post Helpful? 0
  • +
  • -

#13 TMKCodes   User is offline

  • D.I.C Regular
  • member icon

Reputation: 48
  • View blog
  • Posts: 440
  • Joined: 21-March 09

Re: PHP Contest Series 2011 – Challenge #2

Posted 28 February 2011 - 02:17 AM

Will you kill me if my db class has mysql_* and mysqli support or will I have to clear the class of the mysql_* code? Will join this competition as i'm anyway writing similar code at the moment.
Was This Post Helpful? 0
  • +
  • -

#14 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4227
  • View blog
  • Posts: 13,399
  • Joined: 08-June 10

Re: PHP Contest Series 2011 – Challenge #2

Posted 28 February 2011 - 02:20 AM

you would have to clear your class(es) from mysql_* functions, although that should not be that of a problem, if you already have mysqli implemented.
Was This Post Helpful? 0
  • +
  • -

#15 TMKCodes   User is offline

  • D.I.C Regular
  • member icon

Reputation: 48
  • View blog
  • Posts: 440
  • Joined: 21-March 09

Re: PHP Contest Series 2011 – Challenge #2

Posted 10 March 2011 - 07:57 AM

Has the backend for this done, now i just need to write the html and the logic what is loaded when. :)
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2