rand()
, но можно и черезmd5_file()
<input type="submit" value="Заказать!"/>
замените на <input type="submit" name="submit" value="Заказать!"/>
<div id="hide">
<div id="back">
</div>
<form action="" method="POST">
<div id="form">
<div class="form-right">
<br /><br class="hidden"/>
<p><input type="text" name="name" placeholder="ФИО" /></p>
<p><input type="tel" name="number" required=required pattern="^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$" placeholder="Ваш телефон" /></p>
<p><select name="num">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select></p> <br class="visible"/><br class="visible" />
<input type="submit" name="submit" value="Заказать!"/>
</div>
<a href="#" onclick="Unvisible()"><img src="images/close.jpg"></a>
</div>
</form>
</div>
<?php
if($_POST['submit']) {
$title = substr(htmlspecialchars(trim($_POST['name'])), 0, 1000);
$mess = substr(htmlspecialchars(trim($_POST['number'])), 0, 1000000);
$mess .= "\r\n ".$_POST['num'];
$to = 'mail@mail.ru';
$from='order@cobra.ru';
mail($to, $title, $mess, "From: $from");
}
?>