Get Access to All Templates € 49.- Join Today!

Arrow up
Arrow down
×
Forum Access (04 Jul 2019)

These forums are READ-ONLY for Guests, and only WebKomp club members can post. If you are not a member, please look at joining one of our clubs to get access to this forum.

file CallBack Form

5 years 6 months ago #1380 by Alexey
CallBack Form was created by Alexey
I want to insert into page form "Call Me" and wrote some code: twe two blocks (addres and form of two fields) were placed on block of map (on picture).


Code of this block:
<!-- Контейнер для карты -->
<div id="MAP&Callback_Container" style="width:100%;position:relative;margin-left:auto;margin-right:auto;text-align:left;">
<script type="text/javascript" charset="utf-8" src="https://api-maps.yandex.ru/services/constructor/1.0/js/?sid=ZaGwjuk6AV98hhm1dMA2Xz3HKCd7fHNs&width=100%&height=336&lang=ru_RU&sourceType=constructor"></script>
  <div id="wb_Image2" style="width:280px;position:absolute; top:45px; right:10px; z-index:1;">
<img src="images/fon_addr_w_280.png" id="Image2" alt=""></div>
<!-- Форма он-лайн заявки ui-kit -->
<form class="uk-form" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>" style="width:250px; position:absolute; top:50px; right:15px; z-index:2">
    <fieldset>
        <legend>Закажите бесплатную <br> консультацию специалиста</legend>
        <div class="uk-form-row">
		<input required="required" maxlength="30" type="text" name="name" placeholder="Ваше имя"/>
		</div>
        <div class="uk-form-row">
		<input required="required" maxlength="12" type="text" name="phone" placeholder="Ваш телефон"/>
		</div>
		<input type="hidden" name="check" value="vv2319" />
		<div class="uk-form-row">
        <button class="uk-button" input type="submit">Заказать</button>
        </div>
    </fieldset>
</form>
<!-- Адрес -->
<div id="wb_Image2" style="width:250px;position:absolute; top:45px; left:35px; z-index:2;">
<img src="images/fon_addr_w.png" id="Image2" alt=""></div>
  <font color="black"; font-weight="400"><div id="Addres" style="width:250px;position:absolute; top:50px; left:50px; z-index:3;">
  <p class="remove-margin-t"><i class="icon-home"> </i>г. Москва <br> Протопоповский переулок, <br> д.9, стр.1, оф. 306 <br> метро "Проспект Мира"</p> 
<p> <i class="icon-mobile"></i>  +7(925) 814-66-73 <br /> <i class="icon-phone"></i> +7(495)649-45-74 <br /> <i class="icon-print"></i> info@lab-inter.ru <br />
 Время работы: <br />
 ПН-ПТ: 9.00 - 19.00<br />
 СБ-ВС: 10.00 - 18.00
  </p></font>
  </div>
</div>
I have put this code (check for "submission") in index.php:
if($_POST['check']=='vv2319'){
    include 'callback.php';
And in Root of site placed file "callback.php":
<?php
$name = trim(htmlspecialchars(strip_tags(stripslashes($_POST['name']))));
$phone = trim(htmlspecialchars(strip_tags(stripslashes($_POST['phone']))));
if(!empty($name) and !empty($phone)){
	$theme = 'Он-лайн заявка';
	$to = 'info@lab-inter.ru';
	$body = "Имя: $name \nТелефон: $phone";
	$headers = 'From: My Site <'.$to.'>' . "\r\n";
    setcookie('mail', 'sendmail');
    mail($to, $tema, $body, $headers);
    header("Location: ${_SERVER['REQUEST_URI']}");
    die;
}
?>
But after pressing on button "Отправить" (Submit) I have 404-error and in addres line of browser:
localhost/mysite.ru/index.php/<?php%20echo%20$_SERVER[%27REQUEST_URI%27]%20?>
Please, help me for coding of this form.


  • Posts: 14

  • Gender: Unknown
  • Birthdate: Unknown
  • Attachments:

    Please Log in to join the conversation.

    Why Choose WebKomp?

    With all the Joomla Templates and WordPress Theme providers out there, why choose us?  Here are many reasons why a WebKomp template/theme would be a good fit for your website:

    • 47+ Templates and Themes
    • We offer a 14-day money-back guarantee
    • Nice Designs - We take pride in our work and we always looking ways to improve the next template release.
    • Affordable - Our prices are low.
    • Free Support - Need help? Just contact us
    • No Backlink Required - You can shut it off in the template's admin panel.
    • Nice Framework - WebKomp templates are powered by Warp7, Helix, T4, Gantry5 intuitive, wonderful  fast, lightweight, and feature-packed frameworks.
    • Easy to Customize - The admin panel provides many useful options that can be easily tweaked from the backend, easily, change fonts, colors, presets and more.
    • Our templates are based on the open Warp 7 , Helix, T4 and Gantry 5 Framework - Refer to the official Warp documentation, T4 Framework , Helix3/Ultimate, Gantry 5 for comprehensive info about how to use and expand the frameworks.
    • Sample Data Available - Quickstart Package allow you install in few clicks theme/template, extensions/plugins and demo data, in final you get full website exactly the same like on demo.
    • Mobile Friendly - All templates on this site are now responsive, meaning they automatically adjust to any screen resolution.  
    • The Single Template/Theme(12 Months Membership) is dedicated to all customer that need only one Template/Theme for their business or private project.