0) { while ($r = mysql_fetch_assoc($select_response)) { $user_id = intval($r["id"]); } $query = "INSERT INTO `ordered_products` (`product_id`, `user_id`, `seller_id`, `quantity`, `price`, `date`, `time`, `comment`, `phone`, `product_name`, `unit_of_quantity`, `number_of_unit`) VALUES ($product_id, $user_id, $seller_id, $quantity, $price, '".$date."','".$time."','".$comment."' ,'".$phone."', '".$name."', $unit_of_quantity, $number_of_unit)"; mysql_query($query) or $code = 10; }else{ $code = 10; } $mail_message = ' New order
Название товара Количество Сумма Дата Время Телефон Комментрий
'.$name.''.$quantity.''.$price.''.$date.''.$time.''.$phone.''.$comment.'
'; $headers = "Content-type: text/html \r\n"; $headers .= "From: Ярмарка \r\n"; mail("yarmarkapp@gmail.com", "Новый заказ!", $mail_message, $headers); if ($code == 10) header('HTTP/1.0 503', true); echo($code); ?>