I have created Feedback form with PHP,HTML,CSS,JS.
Form Lookalike,
my feedback form Code
https://www.dropbox.com/sh/32zqgejubfllz0h/AACkB_iIh-KJQxtEUikZ8i9Na?dl=0
how can i apply Sidebar Sliding into my home page and all other pages?
I have created Feedback form with PHP,HTML,CSS,JS.
Form Lookalike,
my feedback form Code
https://www.dropbox.com/sh/32zqgejubfllz0h/AACkB_iIh-KJQxtEUikZ8i9Na?dl=0
how can i apply Sidebar Sliding into my home page and all other pages?
app/design/frontend/yourTheme/themeName/layout/local.xml
//add this:
<default>
<reference name="content">
<block type="core/template" name="feedback.box" template="html/feedbackbox.phtml"/>
</reference>
</default>
app/design/frontend/yourTheme/themeName/template/html/feedbackbox.phtml
//Your feedback code goes here.
Now your feedback will be displayed in all Magento content pages.
You should not add <head>
, <html>
and <body>
etc... tags in your phtml, the scripts head you add them in local.xml
app/design/frontend/yourTheme/themeName/template/html/feedbackbox.phtml
<!--Feedback Form HTML START -->
<div id="mrova-feedback">
<div id="mrova-contact-thankyou" style="display: none;">
Thank you. We'hv received your feedback.
</div>
<div id="mrova-form">
<form id="mrova-contactform" action="feedbackbox.phtml" method="post">
<ul >
<li>
<label for="mrova-name">Your Name*</label> <input type="text" name="mrova-name" class="required" id="mrova-name" value="">
</li>
<li>
<label for="mrova-email">Email*</label> <input type="text" name="mrova-email" class="required" id="mrova-email" value="">
</li>
<li>
<label for="mrova-message">Message*</label>
<textarea class="required" id="mrova-message" name="mrova-message" rows="8" cols="30"></textarea>
</li>
</ul>
<input type="submit" value="Send" id="mrova-sendbutton" name="mrova-sendbutton">
</form>
</div>
<div id="mrova-img-control"></div>
</div>
<!-- Feedback Form HTML END -->
<?php
header('content-type: application/json; charset=utf-8');
if (isset($_GET["mrova-name"])) {
$name = strip_tags($_GET['mrova-name']);
$email = strip_tags($_GET['mrova-email']);
$message = strip_tags($_GET['mrova-message']);
$header = "From: ". $name . " <" . $email . ">rn";
$ip = $_SERVER['REMOTE_ADDR'];
$httpref = $_SERVER['HTTP_REFERER'];
$httpagent = $_SERVER['HTTP_USER_AGENT'];
$today = date("F j, Y, g:i a");
$recipient = '[email protected]';
$subject = 'Contact Form';
$mailbody = "
First Name: $name
Email: $email
Message: $message
IP: $ip
Browser info: $httpagent
Referral: $httpref
Sent: $today
";
$result = 'success';
if (mail($recipient, $subject, $mailbody, $header)) {
echo json_encode($result);
}
}
?>
app/design/frontend/yourTheme/themeName/layout/local.xml
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<default>
<reference name="head">
<action method="addItem"><type>skin_css</type><name>css/mrova-feedback-form.css</name></action>
<action method="addItem"><type>skin_js</type><name>js/mrova-feedback-form.js</name></action>
</reference>
<reference name="content">
<block type="core/template" name="feedback.box" template="html/feedbackbox.phtml"/>
</reference>
</default>
</layout>
Now you add your css, js content inside these files in :
skin/frontend/yourTheme/themeName/css/mrova-feedback-form.css
skin/frontend/yourTheme/themeName/js/mrova-feedback-form.js
PHTML = PHP+HTML
:)