Jump to content

Recommended Posts

i have a problem

i want to send data with $_POST but it doesn`t work

 

<td valign="top"><font color="white" face="Verdana,Arial,Helvetica" size="1">Pleasures:</font><br><input type="text"  name="pleasure" size="50" maxlength="50" value="" style="font-family: verdana; font-size: 10px; width: 80px;" >
</td>
<td valign="top"><font color="white" face="Verdana,Arial,Helvetica" size="1">Dogs</font><br><input  type="password" name="dogs" size="20" maxlength="20" value="" style="font-family: verdana; font-size: 10px; width: 80px;" >

 

 

<?php

$pleasure= $_POST['pleasure'];
$dogs=$_POST['dogs'];

$msg="firstcomment:$pleasure\nsecond:$dogs";

mail("test@test.com,"asda",$msg);
?>

 

first is a part of index.html

second is the check.php

 

and i don`t know why when i check the email... the comment is empy and dogs.. even if i write something in them

Link to comment
https://forums.phpfreaks.com/topic/55404-solved-some-help-please/
Share on other sites

<?php
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['message'];
if ($_POST['subsend']) {
  if (mail('to@email.com',$subject,$message,'From: '.$name.' <'.$email.'>'."\r\n")) {
    echo 'Mail sent';
  } else {
    echo 'Mail not sent';
  } //END_if_mail()
} //END_if_subsend
?>
<form action="" method="post">
Name: <input type="text" name="name" value="<?=$name?>" /><br />
Email: <input type="text" name="email" value="<?=$email?>" /><br />
Password: <input type="text" name="subject" value="<?=$subject?>" /><br />
<textarea name="message" cols="60" rows="10"><?=$message?></textarea?><br />
<input type="submit" name="subsend" value="Send Email" />
</form>

 

That is a VERY basic and crude email form off the top of my head but it gives the basic idea.

 

EDIT: Had "Name:" displayed 3 times in HTML - changed one to "Email" and one to "Password"

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.