News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1193669072:v:use_geshi-1:v:type-php

Started by Guest, Oct 29, 2007, 02:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Guest

global $db_prefix, $scripturl;

// Configuration Settings
$from = 'Test Mail Script <you@yourdomain.com>';  
$subject = 'Feedback Submission';
$group = '0';

if (!isset($_POST['submit'])){
   $query = db_query("SELECT ID_MEMBER, realName
      FROM {$db_prefix}members
         WHERE ID_GROUP = $group
         ORDER BY realName", __FILE__, __LINE__);
         
   echo '<form method="post" action="'.$scripturl.'?'.$_SERVER['QUERY_STRING'].'">
    Choose Member:
   <select>';
   
   while ($row = mysql_fetch_assoc($query)){   
      echo '<option name="memid" value="',$row['ID_MEMBER'],'">',$row['realName'],'</option>';   
   }
   
   echo '</select>
';
      
   echo '  
      Your Comment: <textarea name="Comment" rows=4 cols=30></text'.'area>
 
      <input name="submit" type="submit" value="Submit Feedback">  
   </form>';
}
else {
   $query = db_query("SELECT emailAddress
      FROM {$db_prefix}members
         WHERE ID_MEMBER = $_POST[memid] LIMIT 1", __FILE__, __LINE__);
         
   while ($row = mysql_fetch_assoc($query)){
      $sendTo = $row['emailAddress'];
   }
//confirmation page
// Build Message Body from Web Form Input  
$msgBody .= "$_POST[Comment]\n";
 
//make content safe   
$msgBody = htmlspecialchars($msgBody);

 
// Send E-Mail and Direct Browser to Confirmation Page
mail($sendTo, $subject, $msgBody, "From: $from");
   
}

Guest

global $db_prefix, $scripturl;

// Configuration Settings
$from = 'Test Mail Script <you@yourdomain.com>';  
$subject = 'Feedback Submission';
$group = '0';

if (!isset($_POST['submit'])){
   $query = db_query("SELECT ID_MEMBER, realName
      FROM {$db_prefix}members
         WHERE ID_GROUP = $group
         ORDER BY realName", __FILE__, __LINE__);
         
   echo '<form method="post" action="'.$scripturl.'?'.$_SERVER['QUERY_STRING'].'">
    Choose Member:
   <select>';
   
   while ($row = mysql_fetch_assoc($query)){   
      echo '<option name="memid" value="',$row['ID_MEMBER'],'">',$row['realName'],'</option>';   
   }
   
   echo '</select>
';
      
   echo '  
      Your Comment: <textarea name="Comment" rows=4 cols=30></text'.'area>
 
      <input name="submit" type="submit" value="Submit Feedback">  
   </form>';
}
else {
   $query = db_query("SELECT emailAddress
      FROM {$db_prefix}members
         WHERE ID_MEMBER = $_POST[memid] LIMIT 1", __FILE__, __LINE__);
         
   while ($row = mysql_fetch_assoc($query)){
      $sendTo = $row['emailAddress'];
   }
 
// Build Message Body from Web Form Input  
$msgBody .= "$_POST[Comment]\n";
 
//make content safe   
$msgBody = htmlspecialchars($msgBody);

 
// Send E-Mail and Direct Browser to Confirmation Page
mail($sendTo, $subject, $msgBody, "From: $from");
   
}

Guest

global $db_prefix, $scripturl;

// Configuration Settings
$from = 'Test Mail Script <you@yourdomain.com>';  
$subject = 'Feedback Submission';
$group = '0';

if (!isset($_POST['submit'])){
   $query = db_query("SELECT ID_MEMBER, realName
      FROM {$db_prefix}members
         WHERE ID_GROUP = $group
         ORDER BY realName", __FILE__, __LINE__);
         
   echo '<form method="post" action="'.$scripturl.'?'.$_SERVER['QUERY_STRING'].'">
    Choose Member:
   <select>';
   
   while ($row = mysql_fetch_assoc($query)){   
      echo '<option name="memid" value="',$row['ID_MEMBER'],'">',$row['realName'],'</option>';   
   }
   
   echo '</select>
';
      
   echo '  
      Your Comment: <textarea name="Comment" rows=4 cols=30></text'.'area>
 
      <input name="submit" type="submit" value="Submit Feedback">  
   </form>';
}
else {
   $query = db_query("SELECT emailAddress
      FROM {$db_prefix}members
         WHERE ID_MEMBER = $_POST[memid] LIMIT 1", __FILE__, __LINE__);
         
   while ($row = mysql_fetch_assoc($query)){
      $sendTo = $row['emailAddress'];
   }
 
// Build Message Body from Web Form Input  
$msgBody .= "$_POST[Comment]\n";
 
//make content safe   
$msgBody = htmlspecialchars($msgBody);

 
// Send E-Mail  
mail($sendTo, $subject, $msgBody, "From: $from");
   
}

Guest

global $db_prefix, $scripturl;

// Configuration Settings
$from = 'Test Mail Script <you@yourdomain.com>';  
$subject = 'Feedback Submission';
$group = '0';

if (!isset($_POST['submit'])){
   $query = db_query("SELECT ID_MEMBER, realName
      FROM {$db_prefix}members
         WHERE ID_GROUP = $group
         ORDER BY realName", __FILE__, __LINE__);
         
   echo '<form method="post" action="'.$scripturl.'?'.$_SERVER['QUERY_STRING'].'">
    Choose Member:
   <select>';
   
   while ($row = mysql_fetch_assoc($query)){   
      echo '<option name="memid" value="',$row['ID_MEMBER'],'">',$row['realName'],'</option>';   
   }
   
   echo '</select>
';
      
   echo '  
      Your Comment: <textarea name="Comment" rows=4 cols=30></text'.'area>
 
      <input name="submit" type="submit" value="Submit Feedback">  
   </form>';
}
else {
   $query = db_query("SELECT emailAddress
      FROM {$db_prefix}members
         WHERE ID_MEMBER = $_POST[memid] LIMIT 1", __FILE__, __LINE__);
         
   while ($row = mysql_fetch_assoc($query)){
      $sendTo = $row['emailAddress'];
   }
 
// Build Message Body from Web Form Input  
$msgBody = "$_POST[Comment]\n";
 
//make content safe   
$msgBody = htmlspecialchars($msgBody);

 
// Send E-Mail  
mail($sendTo, $subject, $msgBody, "From: $from");
   
}

Guest

global $db_prefix, $scripturl;

// Configuration Settings
$from = 'Test Mail Script <you@yourdomain.com>';  
$subject = 'Feedback Submission';
$group = '0';

if (!isset($_POST['submit'])){
   $query = db_query("SELECT ID_MEMBER, realName
      FROM {$db_prefix}members
         WHERE ID_GROUP = $group
         ORDER BY realName", __FILE__, __LINE__);
         
   echo '<form method="post" action="'.$scripturl.'?'.$_SERVER['QUERY_STRING'].'">
    Choose Member:
   <select>';
   
   while ($row = mysql_fetch_assoc($query)){   
      echo '<option name="memid" value="',$row['ID_MEMBER'],'">',$row['realName'],'</option>';   
   }
   
   echo '</select>';
      
   echo '  
      Your Comment: <textarea name="Comment" rows=4 cols=30></text'.'area>
 
      <input name="submit" type="submit" value="Submit Feedback">  
   </form>';
}
else {
   $query = db_query("SELECT emailAddress
      FROM {$db_prefix}members
         WHERE ID_MEMBER = $_POST[memid] LIMIT 1", __FILE__, __LINE__);
         
   while ($row = mysql_fetch_assoc($query)){
      $sendTo = $row['emailAddress'];
   }
 
// Build Message Body from Web Form Input  
$msgBody = "$_POST[Comment]\n";
 
//make content safe   
$msgBody = htmlspecialchars($msgBody);

 
// Send E-Mail  
mail($sendTo, $subject, $msgBody, "From: $from");
   
}

Guest

 global $db_prefix, $scripturl;

// Configuration Settings
$from = 'Test Mail Script <ichbin@comcast.net>';  
$subject = 'Feedback Submission';
$group = 0;

if (isset($_POST['submit'])){
   $query = db_query("SELECT emailAddress
      FROM {$db_prefix}members
         WHERE ID_MEMBER = ".$_POST['memid']." LIMIT 1", __FILE__, __LINE__);
         
   while ($row = mysql_fetch_assoc($query)){
      $sendTo = $row['emailAddress'];
   }
 
// Build Message Body from Web Form Input  
$msgBody = $_POST['Comment']."\n";
 
//make content safe   
$msgBody = htmlspecialchars($msgBody);

 
// Send E-Mail  
mail($sendTo, $subject, $msgBody, 'From: '.$from);
}


   $query = db_query("SELECT ID_MEMBER, realName
      FROM {$db_prefix}members
         WHERE ID_GROUP = $group
         ORDER BY realName", __FILE__, __LINE__);
         
   echo '<form method="post" action="'.$scripturl.'?'.$_SERVER['QUERY_STRING'].'">
    Choose Member:
   <select name="memid">';
   
   while ($row = mysql_fetch_assoc($query)){   
      echo '<option value="',$row['ID_MEMBER'],'">',$row['realName'],'</option>';   
   }
   
   echo '</select>';
      
   echo '  
      Your Comment: <textarea name="Comment" rows="4" cols="30"></text'.'area>
 
      <input name="submit" type="submit" value="Submit Feedback">  
   </form>';