Page 1 of 1

php webform assistance requested (wait, or is it Python?)

Unread postPosted: Sun Oct 23, 2011 7:55 pm
by Erdrick
Been trying to figure out how to make it work, and a couple days worth of fruitless googling/etc later, yeah, let's try crowdsourcing... Long Story Short, I want to access the "email" data from the webform and have it used as the "FromEmail", so I can see who the email is from, instead of everything being from "myself" or another set address.

Below is the code from the .php file activated by the "post" action; (I can attach the form addy or HTML too, if that would help).

It should be something in the Line #2, (

$fromemail="$_POST['$fieldnm_3']"; // change here if you want


Which was just a set addy earlier...

(Yes, the to email is fake :p)


Any help is greatly appreciated :o

Code: Select all

<?php ob_start();
$fromemail="$_POST['$fieldnm_3']"; // change here if you want
$toemail="";   // change here if you want
$sub="Contact Form";          // change here if you want
////// do not change in following
$fieldnm_1=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_1'])); 
$fieldnm_2=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_2'])); 
$fieldnm_3=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_3'])); 
$fieldnm_4=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_4'])); 
$fieldnm_5=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_5'])); 
$fieldnm_6=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_6'])); 
$fieldnm_7=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_7'])); 
$fieldnm_8=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_8'])); 
$fieldnm_9=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_9'])); 
$fieldnm_10=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_10'])); 

$contentmsg=stripslashes("<br><b><font style=color:#CC3300>$sub</font></b><br>
<table width=708 border=0 cellpadding=2 cellspacing=1 bgcolor=#CCCCCC>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Title *:</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_1</td>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Name *:</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_2</td>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Email *:</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_3</td>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Subject *:</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_4</td>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Message *:</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_5</td>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>City :</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_6</td>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>State :</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_7</td>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>ZIP / Postal Code :</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_8</td>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Country :</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_9</td>

      <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Phone :</b> </td>
      <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_10</td>


$headers  = "MIME-Version: 1.0
$headers .= "Content-type: text/html; charset=iso-8859-1
$headers .= "From: ".$from."


Re: php webform assistance requested

Unread postPosted: Sun Oct 23, 2011 8:00 pm
by Erdrick
(And if this should be rolled into one of the other threads, my bad- just didn't see php listed)