Skip to main content

Form Mail

Here is a simple Form Mail script.   It can be used on your website for people sending you messages, rather than using an email link.   The script provides a form with name, email address, and message.   It validates that all three fields are completed and that the email address format is valid.   It also provides some protection against mail bombing by only allowing 3 messages to be sent from a single browser session.   You can easily modify the script to fit the theme of your site, or change the form.   The example below uses the script name mail.php (see the form action=), so put the script in a file by that name.

- - Start Script Here - -
<?phpif (isset($_POST['send'])) {
  
session_start();
  
$name $_POST['name'];
  
$email $_POST['email'];
  
$content $_POST['content'];
  if (!
preg_match("(^[-\w\.]+@([-a-z0-9]+\.)+[a-z]{2,4}$)i"$email)) $alert "You have entered an invalid email address.";
  if (
$name == "" OR $email == "" OR $content == ""$alert "To send a message, please complete all 3 fields.";
  if (
$_SESSION['mail_count'] >= "3"$alert "Only 3 messages can be sent per session.";
  if (!
$alert) {
    if (!isset(
$_SESSION['mail_count'])) $_SESSION['mail_count'] = 0;
    
$_SESSION['mail_count']++;
    
$message .= "Name as follows:\n\n";
    
$message .= "$name\n\n";
    
$message .= "Email address as follows:\n\n";
    
$message .= "$email\n\n";
    
$message .= "Message as follows:\n\n";
    
$message .= "$content\n\n";
    
mail("mail@yourdomain.com""yourdomain.com Message" "$message""From: Website <>");
    
$name "";
    
$email "";
    
$content "";
    
$alert "Your message has been sent.";
  }
}
?><html>
<head>
</head>
<body>
<table align="center" cellspacing="0" cellpadding="5" style="height: 450px; width: 500px; margin-top: 50; border: solid 1px black;">
<tr><td align="center"><form method="post" action="mail.php"><br>
Send me a message<br><br>
your name<br><input type=text style="width: 330px;" name="name" value="<?=$name?>" maxlength=50><br><br>
your email address<br><input type=text style="width: 330px;" name="email" value="<?=$email?>" maxlength=50><br><br>
your message<br><textarea name="content" rows="6" cols="40"><?=$content?></textarea>
<br><br>
<input type="submit" name="send" value="submit">
</form></td></tr>
</table>
<?phpif ($alert) {
echo 
"<script type='text/javascript'>
<!--
alert ('$alert');
//-->
</script>"
;
}
?></body></html>

- - End Script Here - -

Note that the mail bomb protection feature uses a session variable and will not function if cookies are blocked.

In summary, the only things you need to do are:
1) Change the value mail@yourdomain.com to your email address - in the mail() function
2) Change the value yourdomain.com to your domain name - in the mail() function
3) Put the script in a file called mail.php
4) Upload and enter mail.php in your browser

Comments

Popular posts from this blog

links

0.  https://michael67654.qowap.com/64523001/new-pos-technique-to-perk-up-your-company 1.  https://johnnydinqr.blog2learn.com/52856602/new-pos-system-to-perk-up-your-company 2.  http://edwinsqgcu.onesmablog.com/New-POS-Process-to-Perk-Up-Your-company-43309737 3.  http://chloe69246.bloguetechno.com/New-POS-Process-to-Perk-Up-Your-Business-39814721 4.  http://jacob87541.pointblog.net/New-POS-Technique-to-Perk-Up-Your-online-business-43741223 5.  http://arlette53302.thezenweb.com/New-POS-System-to-Perk-Up-Your-online-business-41464611 6.  http://devinpixna.tinyblogging.com/New-POS-Program-to-Perk-Up-Your-online-business-46354577 7.  https://rylanevsom.blog5.net/46759651/new-pos-program-to-perk-up-your-small-business 8.  https://mariowoesh.affiliatblogger.com/56515206/new-pos-system-to-perk-up-your-organization 9.  https://liam66429.diowebhost.com/60164326/new-pos-procedure-to-perk-up-your-company 10.  https://henry19219.fitnell.com/4557...

Raisonnement, la résolution de problèmes

Les chercheurs ont d'abord développé des algorithmes mimétiques raisonnement humain étapes que les gens utilisent pour résoudre le casse-tête ou faire méthode d'exclusion logique. [2] Dans les années 1980 et 1990 fin, l'étude de la grippe aviaire a développé des méthodes de traitement de l'information incertaine ou incomplète, en utilisant des concepts de probabilité et de l'économie. [3] Pour ces problèmes, les algorithmes requis matériel assez puissant pour effectuer des calculs de géant - à subir « combinaisons d'explosion »: la quantité de mémoire et le temps de calcul peut devenir invisible prendre si la résolution d'un problème difficile. La plus haute priorité est l'algorithme de recherche pour résoudre le problème.  Les gens utilisent généralement les jugements rapides et intuitifs plutôt que pas de déduction que les chercheurs en IA d'origine peuvent simuler. [5] Amnesty International a progressé en utilisant la résolution de problèmes « c...

Tracking and Securing Downloads

If you want to report or track downloads from your website, try this script.   This script will send you an email every time you have a download.   The email will tell you what file was downloaded and who did the download.   You could change this script to keep counts (store them in flat file or MySQL) if you desire. The variable $directory is the directory where the download files are located.   If you want the script in the same directory as the files then use "./" as the directory (you must always have the slash). In your html page, use the following structure as your download link (where name.txt is the file name to download): <a href="download.php?file=name.txt">download</a> Then you use the following script (called download.php): - - Start Script Here - - <?php $emailaddress  =  "email@yourdomain.com" ; $filename  =  $_GET [ 'file' ]; $directory  =  "downloads/" ; $path  =  "$directory$filename" ; putenv (...