You are here: Re: [PHP] returning info. from a form selection « PHP « IT news, forums, messages
Re: [PHP] returning info. from a form selection

Posted by "Mark Rees" on 08/02/05 11:25

> >
> > can anyone give me an idea on how to return info. from a forl
> > pulldown menu
> >
> > 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@example.com','Dropdown
results',$_POST['loan_process'])){
> echo 'Mail sent!';}
> else {
> echo 'Mail NOT sent!';}

Even more basic, no php required (but not suitable for internet use as it
relies on your browser knowing what to do with a mailto link:

<html>
<head>
<title>Dropdown Value to Email</title>
</head>
<body>
<form method="POST" action=mailto:you@you.com>
<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>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация