April 11th, 2013, 02:00 AM
Join Date: Apr 2013
Time spent in forums: 1 h 4 m 22 sec
Reputation Power: 0
PHP-DB - Need help with this php sharing links
Create a basic system for sharing useful links. Any user can view these links, though users have to be given access to post links. Trusted users may be given permission to delete links as well.
At minimum, your site must have the following components:
Configuration File (config.inc.php)
This file (which will be include()d on all pages that require database connectivity) simply declares an array in the following format: $config['db'] – The database to connect to $config['user'] – Database username $config['pass'] – Database password
You should be able to substitute your own config.inc.php to connect to your test database.
The installer is just a simple script that creates any database tables necessary, along with a default user account with administrative privileges. The default username and password should both be 'admin,' and should have all permissions.
New users will be added to the database manually, there is no need to develop a Web front-end for managing users.
If a user is not logged in, they should be presented with a login form. If a user is logged in, they should be redirected to index.php.
Main Page (index.php) – List/Delete Links
Print a neatly formatted list of all of the links posted to the site, and all relevant information (see below). A login link should be printed if the user is not logged in, and a logout button should be printed otherwise.
Users with permission to delete links should be able to do so from this page, using a specific link or button for each link. Users with permission to add new links should see a link to do so. Note: These are two separate permissions.
Create Link (create.php)
Users with permission to add new links will be presented with a form to do so. Users without permission will be taken back to the main page.
The create link form must have the following fields for information associated with it:
• The title of the link
• A brief description of the link
• The actual (valid) URL
When stored, the following must also be assigned to each link:
• A unique identifier for each link
• The time the link was posted.