I've made my own Forms module, the user enters a form which is then sent in email form, and also is inserted into the database (all of that works).
My problem is with the admin area, I cannot get it to work (absolutely NO output within the while() statement, even the simple text). Can anyone take a look at it for me please?
Code:
<?php
/*********************************************************************/
/* Squad Forms admin module made by bretonmage (untouchablesite.com) */
/*********************************************************************/
if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$querystr = "SELECT radminsuper, admlanguage FROM ".$prefix."_authors where aid='$aid'";
$result = sql_query($querystr, $dbi) or die ("invalied query");
list($radminsuper) = sql_fetch_row($result, $dbi);
if ($radminsuper==1) {
echo "$sender_name sent an email with the subject of $radio. <br>The message was: <br><br>$message<br><br><a href=\"mailto:$sender_email\">$sender_email</a><br>AIM: $sender_aim<br>MSN: $sender_msn<br>ICQ: $sender_icq<br>Yahoo: $sender_yahoo<br><br>";
I don't quite understand what you mean... But I tried a new script that my friend suggested and it seems to be working; are there any security problems with it?
Code:
<?php
/*********************************************************************/
/* Squad Forms admin module made by bretonmage (untouchablesite.com) */
/*********************************************************************/
if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$querystr = "SELECT radminsuper, admlanguage FROM ".$prefix."_authors where aid='$aid'";
$result = sql_query($querystr, $dbi) or die ("invalied query");
list($radminsuper) = sql_fetch_row($result, $dbi);
if ($radminsuper==1) {
$mysqlservername = $dbname;
$dbcnx = @mysql_connect($dbhost, $dbuser, $dbpasswd);
if (!$dbcnx) {
echo( "<p>Unable to connect to the " . "database server at this time.</p>" );
exit();
}
if (! @mysql_select_db("$mysqlservername") ) {
echo( "<p>Can't find " . "database.</p>" );
exit();
}
$result = @mysql_query("SELECT * FROM nuke_squad_forms");
while ($resultforms = mysql_fetch_array($result)) {
Opentable();
$radio = $resultforms['radio'];
$sender_name = $resultforms['sender_name'];
$sender_email = $resultforms['sender_email'];
$sender_aim = $resultforms['sender_aim'];
$sender_msn = $resultforms['sender_msn'];
$sender_icq = $resultforms['sender_icq'];
$sender_yahoo = $resultforms['sender_yahoo'];
$message = $resultforms['message'];
echo "$sender_name sent an email with the subject of $radio.<br>";
echo "The message was: <br><br>$message<br><br>";
echo "<a href=\"mailto:$sender_email\">$sender_email</a><br>";
echo "AIM: $sender_aim<br>";
echo "MSN: $sender_msn<br>";
echo "ICQ: $sender_icq<br>";
echo "Yahoo: $sender_yahoo<br><br>";
Closetable();
/*********************************************************************/
/* Squad Forms admin module made by bretonmage (untouchablesite.com) */
/* Thanks to Tristan for helping me get it working. :-) */
/*********************************************************************/
if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$querystr = "SELECT radminsuper, admlanguage FROM ".$prefix."_authors where aid='$aid'";
$result = sql_query($querystr, $dbi) or die ("invalied query");
list($radminsuper) = sql_fetch_row($result, $dbi);
if ($radminsuper==1) {
include("header.php");
GraphicAdmin();
$mysqlservername = $dbname;
$dbcnx = @mysql_connect($dbhost, $dbuname, $dbpass);
if (!$dbcnx) {
echo( "<p>Unable to connect to the " . "database server at this time.</p>" );
exit();
}
if (! @mysql_select_db("$mysqlservername") ) {
echo( "<p>Can't find " . "database.</p>" );
exit();
}
$result = @mysql_query("SELECT * FROM nuke_squad_forms");
Opentable();
echo "<center><b><u>Welcome to the Squad Forms administration module. Here you can view forms that have been sent by your members.</b></u></center>";
Actually, I just got the script to delete records from the table. Unfortunately it deletes ALL records. Here's the script so far:
Code:
<?php
/*********************************************************************/
/* Squad Forms admin module made by bretonmage (untouchablesite.com) */
/* Thanks to Tristan for helping me get it working. :-) */
/*********************************************************************/
if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$querystr = "SELECT radminsuper, admlanguage FROM ".$prefix."_authors where aid='$aid'";
$result = sql_query($querystr, $dbi) or die ("invalied query");
list($radminsuper) = sql_fetch_row($result, $dbi);
if ($radminsuper==1) {
include("header.php");
GraphicAdmin();
$mysqlservername = $dbname;
$dbcnx = @mysql_connect($dbhost, $dbuname, $dbpass);
if (!$dbcnx) {
echo( "<p>Unable to connect to the " . "database server at this time.</p>" );
exit();
}
if (! @mysql_select_db("$mysqlservername") ) {
echo( "<p>Can't find " . "database.</p>" );
exit();
}
$result = @mysql_query("SELECT * FROM ".$prefix."_squad_forms");
Opentable();
echo "<center><b><u>Welcome to the Squad Forms administration module. Here you can view forms that have been sent by your members.</b></u></center>";
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum