Free Press Release Submission




MB Publishing Webmaster Resource ::
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin 


Passing The E-mail Field

 
Post new topic   Reply to topic    MB Publishing Webmaster Resource Forum Index -> Nuke Modules
View previous topic :: View next topic  
Author Message
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 412

PostPosted: Tue Jul 26, 2005 6:44 am    Post subject: Passing The E-mail Field Reply with quote

This code produces a From: "client name" client.name@this.server.com

Rather than the actual client's e-mail address, how can we fix this code to forward the e-mail which has been input?

Code:


if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    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 = 0;
$subject = "$sitename "._FEEDBACK."";
/**********************************/

include("header.php");
include("googleads.php");
if ($cookie[1] != "") {
    $sql = "SELECT name, username, user_email FROM ".$user_prefix."_users WHERE user_id='$cookie[0]'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    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>"._MESSAGE.":</strong><br>
    <TEXTAREA NAME=\"message\" COLS=30 ROWS=5 WRAP=virtual>$message</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_name);
   $msg = "$sitename\n\n";
   $msg .= ""._SENDERNAME.": $sender_name\n";
   $msg .= ""._SENDEREMAIL.": $sender_email\n";
   $msg .= ""._MESSAGE.": $message\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");
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Humpa
Site Admin
Site Admin


Joined: Feb 05, 2004
Posts: 23

PostPosted: Tue Jul 26, 2005 10:32 am    Post subject: sender_email Reply with quote

You need to change this:

$sender_name = removecrlf($sender_name);
$sender_email = removecrlf($sender_name);


To this:

$sender_name = removecrlf($sender_name);
$sender_email = removecrlf($sender_email);
Back to top
View users profile Send private message Visit posters website
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 412

PostPosted: Tue Jul 26, 2005 11:58 am    Post subject: Mail Reply with quote

Like a charm it works ...
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    MB Publishing Webmaster Resource Forum Index -> Nuke Modules All times are GMT + 1 Hour
Page 1 of 1

 

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
Home | News Feeds | Release Archive | Web Marketing | Weight Loss | Publish Your Links | Press Release Topics | Free Downloads | Press FAQs | AvantGO | Amazon Store
Webmaster Forums | Search Releases | Press Topics | Feedback | Submit Press Release | Webmaster Surveys | Recommend | Top | Account | PM | Prweb | Free Link Submission | Add Downloads | New Media | Audio School | TOS

The comments are property of their posters, all the rest 2004 - 2008 by MB
Audana Ltd
You can syndicate our news using the file backend.php
Web site engine's code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.889 Seconds. -