I'm having trouble with a fanlisting mangagement script I'm working on. You can see the error here. It pulls in the file with this code:
<?php $action = 'join'; include ('addict.php'); ?>
addict.php:
<?php
/*************************************
* Addict v0.1 *
* addict.php *
* ================================== *
* Copyright 2005 *
* Coded by Nite Phire *
* http://dissonance.ketsukaiten.net/ *
* nitephire@ketsukaiten.net *
*************************************/
// Connection variables. These are the same for every fanlisting you install on one database.
$mysqlhost = 'localhost';
$mysqluser = 'xxxxxxx';
$mysqlpassword = 'xxxxxxx';
$database = 'ketsuka_addict';
$tableprefix = '';
// Path to management folder, WITHOUT trailing '/'.
$path = '/home/ketsuka/public_html/test/addict';
// Listing-specific MySQL table prefix. This has to be the same value as the prefix with which the individual listing was installed.
$listing = 'aprilsixth';
// Allowed function array.
$getaction = array (
'displayfan' => array ('Display.php', 'DisplayFan'),
'displaylist' => array ('Display.php', 'DisplayList'),
'join' => array ('Join.php', 'Join'),
'started' => array ('Library.php', 'Started'),
'membercount' => array ('Library.php', 'MemberCount'),
'pendingcount' => array ('Library.php', 'PendingCount'),
'updated' => array ('Library.php', 'Updated')
);
// Connects to MySQL.
$connect = mysql_connect ($mysqlhost, $mysqluser, $mysqlpassword)
or die ('Could not connect to MySQL.');
mysql_select_db ($database)
or die ('Could not select database.');
// Retrieves requested function.
require_once ($path . '/' . $getaction[$action][0]);
$getaction[$action][1] ();
// Closes connection.
mysql_close ($connect);
?>
The function being pulled in rests in this file:
<?php
/*************************************
* Addict v0.1 *
* Join.php *
* ================================== *
* Copyright 2005 *
* Coded by Nite Phire *
* http://dissonance.ketsukaiten.net/ *
* nitephire@ketsukaiten.net *
*************************************/
/* Join ()
The main function of this file is to add new
fans to the listing. This accomplished with
the use of a MySQL database table. It adds
fans to the pending members table for
approval by the owner of the listing. */
function Join () {
if (isset ($_POST['join'])) {
if (!isset ($_POST['name']) ||
!isset ($_POST['country']) ||
!isset ($_POST['email']) ||
!isset ($_POST['hideemail'])) {
print ('You did not fill out all of the required fields.
Please go back and make sure to fill out all required fields.
These are Name, Country, Email, and Show/Hide Email.
Thank you.');
};
GLOBAL $tableprefix, $listing;
$name = $_POST['name'];
$country = $_POST['country'];
$email = $_POST['email'];
$hideemail = $_POST['hideemail'];
$website = $_POST['website'];
$comments = $_POST['comments'];
mysql_query ('INSERT INTO ' . $tableprefix . 'addict_pending SET listing="' . $listing . '",
name="' . $name . '",
country="' . $country . '",
email="' . $email . '",
hideemail="' . $hideemail . '",
website="' . $website . '",
comments="' . $comments . '";')
or die ('Could not insert data into database.');
print ('Thank you for joining, ' . $name . '. You have been added to a list of pending members waiting for approval by the admin. You can check back later to verify that you are added. Please do not submit your information again, though, as it just clogs the database.');
} else {
print ('
<form method="post" action="' . $_SERVER['PHP_SELF'] . '">
<table id="joinform">
<tr><td class="joinleft">
Name:
</td>
<td class="joinright">
<input type="text" size="29" name="name" />
</td></tr>
<tr><td class="joinleft">
Country:
</td>
<td class="joinright">
<select size="1" name="country">
[ Country list omitted for 10,000 character limit. ]
</select>
</td></tr>
<tr><td class="joinleft">
Email:
</td>
<td class="joinright">
<input type="text" size="29" name="email" /><br />
<input type="radio" name="hideemail" value="no" /> Show Email Address<br />
<input type="radio" name="hideemail" value="yes" /> Hide Email Address<br />
</td></tr>
<tr><td>
<tr><td class="joinleft">
Website (Optional):
</td>
<td class="joinright">
<input type="text" size="29" name="website" />
</td></tr>
<tr><td class="joinleft">
Questions or Comments?:
</td>
<td class="joinright">
<textarea rows="5" columns="50" name="comments"></textarea>
</td></tr>
<tr><td class="joincenter" colspan="2">
<input type="submit" name="join" value="Submit" />
</td></tr>
</table>
</form>
<br />
Powered by <a href="http://dissonance.ketsukaiten.net/addict/index.php" target="_blank">Addict v0.1</a>.
');
};
};
?>