当前位置: 动力学知识库 > 问答 > 编程问答 >

html - use post method in php mail

问题描述:

I have a form which gets email ID from the client and executes a php file on submitting the form.

The php script will send a mail to the obtained email id along with a link to remove the email ID from the database.

I used 'post' method in the html form to obtain the email ,but I don't know how to use the post method in the email too.

my html form code :

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

<input type="text" name="e1">

<input type="submit" value="send">

</form>

send.php file :

<?php

$to = $_POST['e1'];

$message =

' /* added a html mail along with remove email link */

<a href="mydomain.com/remove.php?data=".$to.>Click to remove</a>

/* Here in the hyperlink to the remove.php ,I have to use post method instead of using '?data='....' get method */

?>

Inside remove.php I have the sql query to remove the $to email . As anyone can use enter data for the '?data=' in the URL, I have to use post method

How can I do it a simple/safer way?

分享给朋友:
您可能感兴趣的文章:
随机阅读: