Commit f1f29dab by zekena

contact+styles

parent 3ab4db56
<?php
if (isset($_POST["submit"])) {
if (empty($_POST["name"])) {
$error .= '<p><label class="text-danger">Please Enter your Name</label></p>';
} else {
$name = clean_text($_POST["name"]);
if (!preg_match("/^[a-zA-Z ]*$/", $name)) {
$error .= '<p><label class="text-danger">Only letters and white space allowed</label></p>';
}
}
if (empty($_POST["email"])) {
$error .= '<p><label class="text-danger">Please Enter your Email</label></p>';
} else {
$email = clean_text($_POST["email"]);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error .= '<p><label class="text-danger">Invalid email format</label></p>';
}
}
if (empty($_POST["message"])) {
$error .= '<p><label class="text-danger">Message is required</label></p>';
} else {
$message = clean_text($_POST["message"]);
}
if ($error == '') {
$file_open = fopen("contact_data.csv", "a");
$no_rows = count(file("contact_data.csv"));
if ($no_rows > 1) {
$no_rows = ($no_rows - 1) + 1;
}
$form_data = array(
'sr_no' => $no_rows,
'name' => $name,
'email' => $email,
'message' => $message
);
fputcsv($file_open, $form_data);
$error = '<label class="text-success">Thank you for contacting us</label>';
$name = '';
$email = '';
$message = '';
}
}
Name,Email,Message
zeyad
23facas
zida@gma.com
3,zeyad,zida@gma.com,23facas
4,zeyad,zida@gma.com,23facas
5,zeyad,zida@gma.com,23facas
6,zeyad,zida@gma.com,23facas
......@@ -137,7 +137,7 @@ body{background-image: url("../Volume.jpg");
border-radius: 17px;
width: 50%;
position: relative;
top: 150px;
top: 10px;
}
#theme {
position: relative;
......
......@@ -137,7 +137,7 @@ body{ background-image: url("../Area.jpg");
border-radius: 17px;
width: 50%;
position: relative;
top: 150px;
top: 10px;
}
#theme {
position: relative;
......
......@@ -133,13 +133,12 @@ body{
-moz-box-shadow: 16px 1px 15px -1px rgba(0,0,0,0.61);
box-shadow: 16px 1px 15px -1px rgba(0,0,0,0.61);
background-color: #3FB74F;
padding:25px 32px;
padding:5px 32px;
height:50%;
border-radius: 17px;
width: 50%;
width: 80%;
position: relative;
top: 150px;
top: 10px;
}
#theme {
position: relative;
......
......@@ -139,7 +139,7 @@ body{
border-radius: 17px;
width: 50%;
position: relative;
top: 150px;
top: 10px;
}
#theme {
position: relative;
......
......@@ -135,9 +135,9 @@ body{background-image: url("../temp.jpg");
height:50%;
border-radius: 17px;
width: 50%;
width: 80%;
position: relative;
top: 150px;
top: 10px;
}
#theme {
position: relative;
......
......@@ -139,7 +139,7 @@ body{
border-radius: 17px;
width: 50%;
position: relative;
top: 150px;
top: 10px;
}
#theme {
position: relative;
......
<?php
$name = '';
$email = '';
$message = '';
if ($_POST['submit']) {
$name = $_POST['name'];
$message = $_POST['message'];
$email = $_POST['email'];
}
$file_open = fopen("contact_data.csv", "a");
$no_rows = count(file("contact_data.csv"));
if ($no_rows > 1) {
$no_rows = ($no_rows - 1) + 1;
}
$form_data = array(
'sr_no' => $no_rows,
$name,
$email,
$message
);
fputcsv($file_open, $form_data);
$error = '<label class="text-success">Thank you for contacting us</label>';
$name = '';
$email = '';
$subject = '';
$message = '';
?>
<!DOCTYPE html>
<!--
This is the front page of the unit calculator,
the user can choose between three themes:
Simple, Fancy and Currency conversion
-->
This is the front page of the unit calculator,
the user can choose between three themes:
Simple, Fancy and Currency conversion
-->
<html lang="en">
<head>
<head>
<title>Unit Calc.</title>
<meta charset="utf-8">
<meta name="description" content="Unit Calc.">
<meta name="author" content="Yusef,Zeyad">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--Browsing for Tablet or Phone dimensions-->
<link rel="stylesheet" href="css/style.css"/>
<!--Browsing for Tablet or Phone dimensions-->
<link rel="stylesheet" href="css/style.css" />
<style>
@import url('https://fonts.googleapis.com/css?family=Passion+One|Roboto+Slab');
#myBtn {
display: none;
position: fixed;
......@@ -36,12 +66,15 @@ Simple, Fancy and Currency conversion
background-color: #555;
}
</style>
</head>
<body>
</head>
<body>
<button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
<script>
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
......@@ -58,19 +91,19 @@ Simple, Fancy and Currency conversion
}
</script>
<a class="navbar">
<span class ="open-slide">
<span class="open-slide">
<a href="#" onclick="openSlideMenu()">
<svg width="30" height="30">
<path d="M0,5 30,5" stroke="#000" stroke-width="5"/>
<path d="M0,14 30,14" stroke="#000" stroke-width="5"/>
<path d="M0,23 30,23" stroke="#000" stroke-width="5"/>
<path d="M0,5 30,5" stroke="#000" stroke-width="5" />
<path d="M0,14 30,14" stroke="#000" stroke-width="5" />
<path d="M0,23 30,23" stroke="#000" stroke-width="5" />
</svg>
</a>
</span>
</nav>
<div id="side-menu" class="side-nav">
<a href="#" class="btn-close" onclick="closeSlideMenu()">&times;</a>
<a href ="#">About Us</a>
<a href="#">About Us</a>
<a href="categories/length.php">Length</a>
<a href="categories/temperature.php">Temperature</a>
<a href="categories/area.php">Area</a>
......@@ -94,13 +127,13 @@ Simple, Fancy and Currency conversion
</section>
<div id="main">
<div class="inner">
<div id="items" class ="box">
<div id="items" class="box">
<div class="box">
<a href="" class="image fit"><img src="icons/length.png" width="400" height="355" alt="Length" /></a>
<div class="inner">
<h2>Length</h2>
<a href="categories/length.php" class="button style3 fit" >Select</a>
<a href="categories/length.php" class="button style3 fit">Select</a>
</div>
</div>
......@@ -150,19 +183,19 @@ Simple, Fancy and Currency conversion
<div class="inner">
<section>
<h3>Contact Us</h3>
<form method="POST" action="">
<form id="Contact_form" method="POST" action="">
<div class="entry">
<input id="Input" class="Input-text" name="name" placeholder="Name">
<input id="Input" class="Input-text" type="email" name="email" placeholder="Email">
<input id="Input" class="Input-text" name="message" placeholder="Message">
<input id="Input-name" class="Input-text" name="name" placeholder="Name" required>
<input id="Input-email" class="Input-text" type="email" name="email" placeholder="Email" required>
<input id="Input-message" class="Input-text" name="message" placeholder="Message" required>
</div>
<div class="registerSubmit">
<input type="submit" name="submit" value="Submit">
</div>
</form>
<div id="results"></div>
</section>
</footer>
</body>
</body>
</html>
\ No newline at end of file
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment