Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <span id="price">900</span>
- <form id="contruct-from">
- <input name="namecontr">
- <input name="telcontr">
- <input name="emailcontr">
- <button form="contruct-from" type="submit">ОТПРАВИТЬ</button>
- </form>
- $('.btn-contruct').click(function(){
- if($("#contruct-from")[0].checkValidity()) {
- $.post('Post_Constructor.php', '&item_price=' + $('#price').text() + $('#contruct-from').serializeArray(), function(data) {
- });
- console.log('ok');
- return false;
- }
- });
- <?php
- session_start();
- new post_contact($_POST);
- class post_contact
- {
- public function __construct($post_data)
- {
- $this->send_contact_form($post_data);
- }
- function send_contact_form($post_data)
- {
- $headers = "MIME-Version: 1.0" . PHP_EOL .
- "Content-Type: text/html; charset=utf-8" . PHP_EOL .
- 'From: test@email.com <test@email.com>' . PHP_EOL;
- $message = '<p>'.$_POST['namecontr'].'</p>';
- $message .= '<p>'.$_POST['telcontr'].'</p>';
- $message .= '<p>'.$_POST['emailcontr'].'</p>';
- $message .= '<p>'.$_POST['item_price'].'</p>';
- mail('test@email.com', 'Помогите пожалуйста', $message, $headers );
- }
- }
- $('#contruct-from').serialize()
- $('#contruct-from').serializeArray();
- $.post('Post_Constructor.php', 'item_price=' + $('#price').text() +'&'+ $('#contruct-from').serialize(), function(data) {});
Add Comment
Please, Sign In to add comment