Re: formmail
| From: | Adam Voigt | Date: | Thu, 15 May 2003 13:51:29 +0000 |
| Subject: | Re: formmail | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147705@lists.php.net to get a copy of this message | ||
When you use the variable's in a URL, it's
$_GET, not $_POST. Change your code to reflect this.
On Thu, 2003-05-15 at 09:47, Franz Max wrote:
> Hi All,
>
> I have got a form that I want to send as mail to an address. I can't use the
> MAILTO method, because it requires a mail client on the users machine. Most
> of my clients do not have mail client, they use any webmail provider as
> well.
>
> How can I send the form as mail, if there is no php installed on my server?
> But I can use an another server with php installed.
>
> I've put in the form tag the target... If I hit the submit button, a new
> window will be open with this address line:
>
>
> http://www.myserver.hu/reporttocs.html?uname=THENAME&clanname=CLAN&emailaddr=C@CC.COM&mobile=06012301232&polosize=S&agreecheck=on&submit=Elk%FCldx<°oä->¥Š¨u
> Õ¿
>
> So the phpmail.php can't get the form fields. WHYYYYY?
>
> The form is:
>
> <FORM target="http://www.softbolt.hu/phpmail.php"
> onsubmit="return
> formCheck(this);">
> <TABLE width=100%>
> <tr><td class="verdana10" align="right">Nv:
> <td align="left"><INPUT TYPE="text" NAME="uname"
> MAXLENGTH="30" >
> <tr><td class="verdana10" align="right">Kln neve:
> <td align="left"><INPUT TYPE="text" NAME="clanname"
> MAXLENGTH="30" >
> <tr><td class="verdana10" align="right">Te vagy a klnvezr?
> <td align="left"><INPUT TYPE="checkbox" NAME="leader"
> >
> <tr><td class="verdana10" align="right">e-mail cm:
> <td align="left"><INPUT TYPE="text" NAME="emailaddr"
> VALUE="@">
> <tr><td class="verdana10" align="right">Mobilszm:
> <td align="left"><INPUT TYPE="text" NAME="mobile"
> VALUE="06">
> <tr><td class="verdana10" align="right">Plmretem:
> <td align="left"><SELECT NAME="polosize"><OPTION
> VALUE="S">S<OPTION
> VALUE="M">M<OPTION VALUE="L">L<OPTION
> VALUE="XL">XL<OPTION
> VALUE="XXL">XXL</SELECT>
> <tr><td class="verdana10" align="right">A szablyokat elfogadom
> <td align="left"><INPUT TYPE="checkbox"
> NAME="agreecheck"
> onClick="agreesubmit(this)">
> <tr><td>
> <td align="left"><INPUT TYPE="submit" NAME="submit"
> VALUE="Elkld"
> disabled>
> <tr><td>
> <td class="verdana10" align="left"><a
> href="javascript:window.close();">bezr</a>
> </TABLE>
> </FORM>
> -------------
>
> Here is my phpmail.php:
> ------------
> <?php
> $to = "info@matrix-cafe.hu";
> $subject = "Jelentkezsi lap";
> $body = "";
>
> if( $_POST['cname'] ) {
> $body = sprintf( "Nevez: %s\n", $_POST['uname'] );
> }
>
> if( $_POST['clanname'] ) {
> $body. = sprintf( "Kln : %s\n", $_POST['clanname'] );
> }
>
> if( $_POST['leader'] ) {
> if( $_POST['leader'] == 'on' ) {
> $body. = "Klnvezr\n";
> }
>
> if( $_POST['emailaddr'] ) {
> $body. = sprintf( "email : %s\n", $_POST['emailaddr'] );
> }
>
> if( $_POST['mobile'] ) {
> $body. = sprintf( "mobil : %s\n", $_POST['mobile'] );
> }
>
> if( $_POST['polosize'] ) {
> $body. = sprintf( "pl : %s\n", $_POST['polosize'] );
> }
>
> $rt = @mail($to, $subject, $body,
> "From: webmaster@$SERVER_NAME\r\n"
> ."Reply-To: webmaster@$SERVER_NAME\r\n"
> ."X-Mailer: PHP/" . phpversion()););
> ?>
> -------
>
> Thanx for any answer
>
> regards
> Franz
>
>
--
Adam Voigt (adam@cryptocomm.com)
Linux/Unix Network Administrator
The Cryptocomm Group