[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Adding recipient drop down menu to a simple form processor?

I am trying to add a simple drop down menu to my contact page that will allow the user to select a recipient before they enter their message rather then have it sent to a pre-defined user.

Is there a simple (free) form processor somewhere that does this or is the code easy enough for someone to punch up here?

Much appreciated!

rob
0
rkingsbury
Asked:
rkingsbury
  • 5
  • 4
1 Solution
 
VGRCommented:
very easy

just drop in your FORM something like this :

<SELECT NAME=selectname SIZE=1>
<OPTION VALUE=1>text for value 1
<OPTION VALUE=2>text for value 2
<OPTION VALUE=3>text for value 3
</SELECT>

and you are done
0
 
rkingsburyAuthor Commented:
Let me clarify..
I have a form processor.
I have multiple recipients.
How do I like the two using a simple dropdown menu. I'm pretty sure it's going to have something to do with arrays and variables rather then straight up HTML :)

Thanks for the quick reply though.
0
 
VGRCommented:
in PHP, yes, but as "you have a form processor" (sic)(1), search in its documentation :/

(1) mine is wordpad

something like this may help you :
It's for selecting a recipient in a "private message" of my forum.

Just adapt to your DB layout, change pseudo for email address field, and you're done [ie : I leave you some work to do, provided you did not at all give a lot of details on the first place :D ]

<?
echo "<SELECT name=destinataire>"; // ni multiple ni size=
$linkID=mysql_connect("$dbHost","$dbLogin","$dbPassword") or die ("bad connect".mysql_error());
mysql_select_db($dbName,$linkID) or die ("bad select DB ".mysql_error());
$query="select * from $dbTableUsers order by pseudo asc;";
$result=mysql_query($query,$linkID) or die ("bad query sel users ".mysql_error());
while ($res=mysql_fetch_array($result)) {
  echo "<option value=\"".$res["pseudo"]."\"".(($dest==$res["pseudo"])?" SELECTED":"").">".$res["pseudo"]."</option>";
} // affichage
echo"</select>";
?>
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
rkingsburyAuthor Commented:
Thanks.

0
 
VGRCommented:
I will ask for the grade to be changed from "C" to any other value.
I don't appreciate this, given you thank me and I gave the "code answer" that you requested.
see you later
0
 
rkingsburyAuthor Commented:
Jeez buddy relax, I didn't know you were gonna whine about it or I'd have sent you some roses too..

Look, I gave you a C because you started out with a piece of HTML dropdown code that was totally not what I needed and then when I asked for a few more details on how to hard code a few recipients in, you gave me a big SQL deal. Sure, it may work good and all, but it's not at all what I needed: major overkill. I needed something completely different then you were offering and so I down-graded you. Big deal - that's life. You don't cry about it..

So anyway, if you want, I'll go in and give you an A even though you really didn't give me the answer I needed. Let me know if that's what you want and I'll go ahead and give you the stupid points you apparently desperately need.

rob
0
 
VGRCommented:
you're totally wrong in almost everything you wrote in the last message :D

"I am trying to add a ***simple*** drop down menu to my contact page that will allow the user to select a recipient before they enter their message rather then have it sent to a pre-defined user." (emphasis is mine)
--> simple asked, simple given
Moreover, you reiterate above that you asked "how to hard code a few recipients in" AND I PROVIDED THE HTML CODE NECESSARY AND SUFFICIENT TO HARDCODE SOME RECIPIENTS. Did I not ?

"Is there [...] or is the code easy enough for someone to punch up here?"
--> "code" was imprecise. I gave you HTML code. Then I gave you PHP code. You call those pityful 9 lines of PHP doing a loop for OPTIONs 'a big SQL deal', well it's your problem man :D
"major overkill" for a simple "for" loop that one way or an other you'll need to "code" your loop : maximal fun here reading you.

c'est bon de rire quelquefois 8-)


PS don't woeey about cries, points or grades, but learn to express yourself in such a way people wil not "propose solutions that are not what you needed"

especially when you ask for "trying to add a simple drop down menu to my contact page [...] how to hard code a few recipients in" and you get the relevant (HTML) code ;-)
0
 
VGRCommented:
PPS : I love you too ;-)
0
 
Computer101Commented:
Grade changed as requested

Computer101
E-E Admin
0
 
rkingsburyAuthor Commented:
Ok, well, whatever.

Like I said..

Thanks.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now