$value) { $out[$key] = $value; } } elseif ($method == "POST") { foreach ($_POST as $key => $value) { $out[$key] = $value; } } else { $out = ""; } return $out; } $formData = Parse_Form(); foreach ($formData as $key => $value) { $$key = $value; } if (!ini_get("register_globals")) { extract($_GET, EXTR_SKIP); } // include configuration and password protection include("config.php"); include("protection.php"); ?> Beqanna Members Database

add new horse
approve user-sent horses
edit/delete horses


add categories
edit/delete categories
logout

Entries

There are horses, of which are waiting to be approved.

ID: ">
Horse Name:
(remember: no quotation marks!)
">
Player:">
Breed - Sire x Dam - Gender - Other:">
Name:">
Email:">
URL:"> (" target="_blank">visit it)
Comments:
Choose a Category:
Action:

";} } elseif ($action == "approve"){ if ($what == "up"){ if ($sendernotify == "Y"){ $recipient = "$_POST[email]"; $subject = "$sitename: The horse has been successfully added."; $mailheaders = "From: $adminemail\n"; $mailheaders .= "Reply-To: $adminemail\n\n"; mail($recipient, $subject, "Hi $_POST[name], your entry has been added to the database at $sitename ($siteurl). Here's what you submited: \n\n Horse: $_POST[quote] \n Player: $_POST[author] \n Author Complement: $_POST[complem] \n Name: $_POST[name] \n Email: $_POST[email] \n URL: $_POST[url] \n\n Thanks! \n\n $adminname \n $admincollective", "$mailheaders"); } $query = "UPDATE $table SET relCatID='$relCatID', quote='$quote', author='$author', complem='$complem', name='$name', email='$email', url='$url', comments='$comments', apr='y' WHERE quoteID='$quoteID'"; mysql_query($query); } elseif ($what == "del"){ $query = "DELETE from $table WHERE quoteID='$quoteID'"; mysql_query($query); } $result = mysql_query ("SELECT * FROM $table WHERE apr!='y'"); if ($row = mysql_fetch_array($result)) { do { ?>
ID: ">
Horse Name:
(remember: no quotation marks!)
">
Player: ">
Breed - Sire x Dam - Gender - Other: ">
Name: ">
Email: ">
URL: "> (" target="_blank">visit it)
Comments:
Choose a Category:
Action:
No more unapproved horses! Click here to go back to the main Admin Panel.

";} } elseif ($action == "addquote"){ ?>

Add Horses

Horse Name:
(remember: no quotation marks!)
Player:
Breed - Sire x Dam - Gender - Other/None:
Category:
The entry was successfully added.

"; } elseif ($action == "edit"){ ?>

Edit an Entry

ID:
Horse Name:
(one or two key words may be enough)
Player:
Breed - Sire x Dam - Gender - Other/None:
Name:
Email:
URL:

Edit Horse Information

ID: ">
Horse Name: ">
Player: ">
Breed - Sire x Dam - Gender - Other/None: ">
Name: ">
Email: ">
URL: "> (" target="_blank">visit it)
Comments:
Category:
Action:
Sorry, no records were found! Please try again.
Tip: you don't have to fill in all the fields in the Edit form. Filling in just one or two will return all quotes with that information, it works like a search form. :)

";} } elseif ($action == "mod_quote"){ echo "

This entry was"; if ($what == "up"){ $query = "UPDATE $table SET relCatID='$relCatID', quote='$quote', author='$author', complem='$complem', name='$name', email='$email', url='$url', comments='$comments', apr='y' WHERE quoteID='$quoteID'"; mysql_query($query); echo " updated"; } elseif ($what == "del"){ $query = "DELETE from $table WHERE quoteID='$quoteID'"; mysql_query($query); echo " deleted"; } echo " successfully!

"; } elseif ($action == "addcat"){ ?>

Add a Category

Only Dianna should add categories...

This category has been added!

"; } elseif ($action == "cat_mod"){ ?>

Edit a Category

Only Dianna should edit categories...

actual category name

category's new name

What do you wanna do?
Be aware: if you delete a category, you will delete all horse records within that category!

Category modified.

"); } elseif ($what == "del"){ mysql_query("DELETE FROM $table_cat WHERE catID = $catID"); mysql_query("DELETE FROM $table WHERE relCatID = $catID"); print ("

Category and all its quotes deleted.

"); } } elseif ($what == "invalid"){ ?>

Invalid login name or password!
Please press the back button on your browser to try again.

Readme file for reference