Jump to content

[SOLVED] some help please


adv

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("[email protected],"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('[email protected]',$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"

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.