Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
tag
Regular
Regular



Joined: Dec 18, 2003
Posts: 53
Location: Worldwide

PostPosted: Fri Sep 03, 2004 9:45 am Reply with quote

Using Chatservs Feedback module I was trying to make A Staff Application module for my site., But whatever I have done, it will not send the mail

Here is the script:

Quote:

<?PHP

if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

/**********************************/
/* Configuration */
/* */
/* You can change this: */
/* $index = 0; (right side off) */
/**********************************/
$index = 1;
$subject = "$sitename "._FEEDBACK."";
/**********************************/

include("header.php");
$cookie[0] = intval($cookie[0]);
if ($cookie[1] != "") {
$row = $db->sql_fetchrow($db->sql_query("SELECT name, username, user_email FROM ".$user_prefix."_users WHERE

user_id='$cookie[0]'"));
if ($row['name'] != "") {
$sender_name = $row['name'];
} else {
$sender_name = $row['username'];
}
$sender_email = $row['user_email'];
}

$form_block = "
<center><font class=\"title\"><b>$sitename: "._FEEDBACKTITLE."</b></font>
<br><br><font class=\"content\">"._FEEDBACKNOTE."</font>
<FORM METHOD=\"post\" ACTION=\"modules.php?name=$module_name\">
<P><strong>"._YOURNAME.":</strong><br>
<INPUT type=\"text\" NAME=\"sender_name\" VALUE=\"$sender_name\" SIZE=30></p>
<P><strong>"._YOUREMAIL.":</strong><br>
<INPUT type=\"text\" NAME=\"sender_email\" VALUE=\"$sender_email\" SIZE=30></p>
<P><strong>"._WHERE.":</strong><br>
<TEXTAREA NAME=\"WHERE1\" COLS=30 ROWS=1 >$WHERE1</TEXTAREA></p>
<TEXTAREA NAME=\"WHERE2\" COLS=30 ROWS=1 >$WHERE2</TEXTAREA></p>
<TEXTAREA NAME=\"WHERE3\" COLS=30 ROWS=1 >$WHERE3</TEXTAREA></p>
<TEXTAREA NAME=\"WHERE4\" COLS=30 ROWS=1 >$WHERE3</TEXTAREA></p>
<P><strong>"._MESSAGE1.":</strong><br>
<TEXTAREA NAME=\"message\" COLS=30 ROWS=5 WRAP=virtual>$message1</TEXTAREA></p>
<P><strong>"._MESSAGE2.":</strong><br>
<TEXTAREA NAME=\"message\" COLS=30 ROWS=5 WRAP=virtual>$message2</TEXTAREA></p>
<P><strong>"._MESSAGE3.":</strong><br>
<TEXTAREA NAME=\"message\" COLS=30 ROWS=5 WRAP=virtual>$message3</TEXTAREA></p>
<INPUT type=\"hidden\" name=\"opi\" value=\"ds\">
<P><INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\""._SEND."\"></p>
</FORM></center>
";

OpenTable();
if ($opi != "ds") {
echo "$form_block";
} elseif ($opi == "ds") {
if ($sender_name == "") {
$name_err = "<center><font class=\"option\"><b><i>"._FBENTERNAME."</i></b></font></center><br>";
$send = "no";
}
if ($sender_email == "") {
$email_err = "<center><font class=\"option\"><b><i>"._FBENTEREMAIL."</i></b></font></center><br>";
$send = "no";
}
if ($message == "") {
$message_err = "<center><font class=\"option\"><b><i>"._FBENTERMESSAGE."</i></b></font></center><br>";
$send = "no";
}
if ($send != "no") {
$sender_name = removecrlf($sender_name);
$sender_email = removecrlf($sender_email);
$msg = "$sitename\n\n";
$msg .= ""._SENDERNAME.": $sender_name\n";
$msg .= ""._SENDEREMAIL.": $sender_email\n";
$msg .= ""._WHERE.": $where1\n\n";
$msg .= ""._WHERE.": $where2\n\n";
$msg .= ""._WHERE.": $where3\n\n";
$msg .= ""._WHERE.": $where4\n\n";
$msg .= ""._MESSAGE1.": $message1\n\n";
$msg .= ""._MESSAGE2.": $message2\n\n";
$msg .= ""._MESSAGE3.": $message3\n\n";
$to = $adminmail;
$mailheaders = "From: $sender_name <$sender_email>\n";
$mailheaders .= "Reply-To: $sender_email\n\n";
mail($to, $subject, $msg, $mailheaders);
echo "<P><center>"._FBMAILSENT."</center></p>";
echo "<P><center>"._FBTHANKSFORCONTACT."</center></p>";
} elseif ($send == "no") {
OpenTable2();
echo "$name_err";
echo "$email_err";
echo "$message_err";
CloseTable2();
echo "<br><br>";
echo "$form_block";
}
}

CloseTable();
include("footer.php");

?>

any help is appreciated


Last edited by tag on Fri Sep 03, 2004 1:32 pm; edited 1 time in total 
View user's profile Send private message Visit poster's website
chatserv
Member Emeritus



Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Fri Sep 03, 2004 11:53 am Reply with quote

Will it send the email if you remove your modifications?
 
View user's profile Send private message Visit poster's website
tag







PostPosted: Fri Sep 03, 2004 1:26 pm Reply with quote

Yes it works without the modifications with no problem

EDIT: Actually I renamed this file to application.php, then put it in the modules/Staff/ directory along with the lang-engish dir, and it does not work from there, and I see nothing in the code that makes it read from just the "Feedback" directory - that is using the stock feedback, without changes.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©