Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection determines email recipient

Status
Not open for further replies.

benzito

ISP
Jan 8, 2002
144
US
Does anyone know how you can use a drop-menu on a form so that a visitor could direct a question to a particular recipient? Here's the code in php, unfortunately the server I have to work w/ doesn't support it. I thought there might be a solution avail w/ asp? Any suggestions appreciated.

<?
if(!$submit){
?>

<form action=&quot;<? echo $PHP_SELF ?>&quot; method=&quot;post&quot;>

Select Product:
<select name=&quot;what&quot;>
<option>---
<option>Product A
<option>Product B
</select>

<br>

From:
<input name=&quot;from&quot;><br>

Subject:
<input name=&quot;subject&quot;><br><br>
Message:<br>
<textarea name=&quot;message&quot; rows=&quot;8&quot; cols=&quot;30&quot;>
 
It looks to me like you want the form to post to the same page it is embedded in?

In ASP ->

<!-- thispage.asp -->
<%
Dim sWhat, sFrom, sSubject
sWhat = Request(&quot;sWhat&quot;)
sFrom = Request(&quot;sFrom&quot;)
sSubject = Request(&quot;sSubject&quot;)
%>

<form action=&quot;thispage.asp&quot; method=&quot;post&quot;>

Select Product:
<select name=&quot;what&quot;>
<option>---
<option>Product A
<option>Product B
</select>

<br>

From:
<input name=&quot;from&quot;><br>

Subject:
<input name=&quot;subject&quot;><br><br>
Message:<br>
<textarea name=&quot;message&quot; rows=&quot;8&quot; cols=&quot;30&quot;>


When the form submit button is pressed, the page is posted to itself. Then at the top of the page, the values that were entered into the form are available to you in sWhat, sProduct and sFrom. You can populate these values into an email, or text file, or database or whatever!
Brett Birkett B.Comp
Systems Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top