RE: returning info. from a form selection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> can anyone give me an idea on how to return info. from a forl 
> pulldown menu
> 
> eg:
> 
> <select class="textbox" 
>                         name="loan_process">
>                       <option value="" 
>                           selected="selected">Purchase</option>
>                       <option 
>                           value="">Construct Home</option>
>                       <option>
> </select>
> 
> and return that to an email address.
> 

A most basic question begs a most basic answer:

<?
if (!$_POST['submit']){ // Display form
?>
<html>
<head>
<title>Dropdown Value to Email</title>
</head>
<body>

<form method="POST" action="<? echo $_SERVER['PHP_SELF'];?>">
<select name="loan_process">
  <option value="Purchase">Purchase</option>
  <option value="Construct">Construct Home</option>
  </select><input type="submit" value="Submit" name="submit">
</form>
</body>
</html>

<? 
}else{ // Mail form results
if(mail('recipient@xxxxxxxxxxx','Dropdown results',$_POST['loan_process'])){
  echo 'Mail sent!';} 
else {
  echo 'Mail NOT sent!';}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux