I put google's recaptcha in my site and it looks really weird when I open it, here's a picture:
my form works and all i just need the recaptcha to prevent bots from spamming or idk what. Thanks!
EDIT: better picture:
Here's my html and php code:
<?php
if (isset($_POST['g-recaptcha-response'])){
var_dump($_POST)
$ip = $_SERVER['REMOTE_ADDR'];
$captcha= $_POST['g-recaptcha-response'];
$secret = 'XXXXXXXXXX';
$respo = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secret&response=$captcha&remoteip=$ip");
if (isset($data->success) AND $data->success==true) {
} else {
}
}
?>
<html>
<head>
<title>Register</title>
<link rel="stylesheet" type="text/css" href="faggot.css">
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body style="background: url('../t2.png');height: 1700px;"> <!-- body -->
<h1 id="h1">Register</h1>
<form action="register.php" method="post" name="form1" style="background: url('../t1.png');">
<div>
<ul class="ull" id="nameull">
<br>
<br>
<br>
<br>
<div class="div">
<li class="margtop"><h2 class="tooltip" >First name<span class="red">*</span></h2></li>
<li class="margtop"><input id="fnamee" class="bax" type="text" name="fname" required="yes" pattern="^[a-z1-9]+"></li>
</div>
</ul>
<ul class="ull" style="display: inline-block;" id="lname">
<div>
<li class="margtop"><h2 class="tooltip" id="lnaam">Last name<span class="red">* </span></h2></li>
<li class="margtop"><input class="bax" type="text" name="lname" required="yes"></li>
</div>
</ul>
<br>
<br>
<br>
<br>
<br>
<br>
<ul>
</ul>
<ul class="ull" id="pwull">
<li class="margtop"><h2 class="tooltip" style="margin-right: 30px;">Password<span class="red">*</span></h2><input id="pwinput" class="bax" type="password" name="pw" required="yes"><span class="tp" id="pwinc">Password is encrypted!</span></li>
</ul>
<ul class="ull" id="usrull">
<div class="div" id="div1">
<li>
<h2 class="tooltip">Username<span class="red">*</span></h2>
<input style="margin-left: 40px;margin-top: 100px;width: 200px;" class="bax" type="text" name="uname" required="yes"><span class="tp" id="op">Only use lowercase letters!</span>
</li>
</div>
</ul>
<ul class="ull" id="emailull">
<div class="div">
<li class="margtop"> <h2 class="tooltip" id="emel">Email<span class="red">*</span></h2><input style="margin-left: 40px;margin-top: 100px;width: 300px;" class="bax" type="email" name="email" required="yes"><span class="tp" id="oep">Only one email per account!</span></li>
</div>
</ul>
<ul class="ull" style="margin-left: 500px;margin-top: 100px;display: inline-block;width: 130%;">
<li><div style="" class="g-recaptcha" data-sitekey="XXXXXXXXXXXXXX"></div></li>
</ul>
<ul>
<div class="div">
<li>
<input class="bax" id="sabmitbat" type="submit" value="submit" name="submit1">
</li>
</div>
</ul>
</table>
</form>
<script type="text/javascript" src="jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="buttonbg.js"></script>
</body>
</html>
Related
This question already has answers here:
How to fix "Headers already sent" error in PHP
(11 answers)
Closed 2 years ago.
I am creating a project on the school management system using PHP and I am stuck as it's giving me an error: Cannot modify header information - headers already sent.
If the user forgot to fill any field and click on the submit button,the server should return a message like fill this field but instead it's giving this error and I don't know why.
this is the error I am getting
this is my form
This is my home page
<?php
session_start();
require_once 'header.php';
if(!isset($_SESSION['name']))
{
die("Access Denied");
}
if(isset($_POST['logout']))
{
header('Location: logout.php');
return;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght#400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght#300;400;500&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js#2.8.0"></script>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="../management/dashboard/css/admin.css">
<link rel="stylesheet" href="../management/student/css/addstudent.css">
<link rel="stylesheet" href="../management/student/css/allstudent.css">
<link rel="stylesheet" href="../management/student/css/studentdetail.css">
</head>
<body>
<header>
<nav>
<div class="logo">
<div class="img">
<img src="./images/logo3.png" alt="">
</div>
</div>
<ul class="nav-links">
<li id="n-1">
<div class="admin">
<p>Konark Shivam</p>
<i class="fas fa-user-circle"></i>
</div>
</li>
<li id="n-2">
<i class="fas fa-envelope"></i>
</li>
<li id="n-3">
<i class="fas fa-bell"></i>
</li>
<li id="n-4">
<i class="fas fa-sign-out-alt"></i>
</li>
</ul>
<div class="burger" id="burger">
<i class="fas fa-bars"></i>
</div>
</nav>
</header>
<!-- for logout -->
<section>
<div class="logout-box" id="logout-box">
<div class="logout-content">
<p>Do you want to logout</p>
<form method="post">
<div class="logout-button">
<input type="submit" name="logout" value="Logout">
<input type="submit" name="cancel" value="Cancel" id="logout-cancel" onclick="return false">
</div>
</form>
</div>
</div>
</section>
<menu>
<div class="left-menu" id="left-menu">
<ul>
<li class="menu-items" id="menu-item-1">
Dashboard
<span class="arrow">></span>
</li >
<div class="drop-menu" id="drop-menu-1">
<ul>
<li class="drop-items">
<div class="name"></div>
<a id="d-i-admin" href="home.php?page=dashboard/admin">> Admin</a>
</li>
<li class="drop-items">
<div class="name"></div>
> Teacher
</li>
<li class="drop-items">
<div class="name"></div>
> Students
</li>
<li class="drop-items">
<div class="name"></div>
> Parents
</li>
</ul>
</div>
<li class="menu-items" id="menu-item-2">
<span>Student</span>
<span class="arrow">></span>
</li>
<div class="drop-menu" id="drop-menu-2">
<ul>
<li class="drop-items">
<div class="name"></div>
> All Students
</li>
<li class="drop-items">
<div class="name"></div>
> Student Details
</li>
<li class="drop-items">
<div class="name"></div>
> Admission Form
</li>
<li class="drop-items">
<div class="name"></div>
> Student Promotion
</li>
</ul>
</div>
<li class="menu-items" id="menu-item3">
<span>Teacher</span>
<span class="arrow">></span>
</li>
<div class="drop-menu" id="drop-menu-3">
<ul>
<li class="drop-items">
<div class="name"></div>
> Admin
</li>
<li class="drop-items">
<div class="name"></div>
> Teacher
</li>
<li class="drop-items">
<div class="name"></div>
> Students
</li>
<li class="drop-items">
<div class="name"></div>
> Parents
</li>
</ul>
</div>
<li class="menu-items">
<span>Parents</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Library</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Subjects</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Class Routines</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Attendence</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Exams</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Transport</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Hostel</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Notice</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Message</span>
<span class="arrow">></span>
</li>
<li class="menu-items">
<span>Accounts</span>
<span class="arrow">></span>
</li>
</ul>
</div>
</menu>
<main>
<div class="presentation">
<div class="my-container" id="container">
<?php
if(isset($_GET['page']))
{
$page=$_GET['page'];
include_once $page.'.php';
}
else{
include_once 'dashboard/admin.php';
}
?>
</div>
</div>
</main>
<script src="script.js"></script>
</body>
</html>
this is my addstudent page
<?php
ob_start();
if(!isset($_SESSION['name']))
{
die("Access Denied");
}
require_once 'pdo.php';
if(isset($_POST['submit']))
{
if(isset($_POST['f_name']) && isset($_POST['l_name']) && isset($_POST['gender']) && isset($_POST['dob']) && isset($_POST['blood'])
&& isset($_POST['religion']) && isset($_POST['email']) && isset($_POST['address']) && isset($_POST['phone']) )
{
if(strlen($_POST['f_name'])<1)
{
$_SESSION['error']='Please enter first name';
header('Location:home.php?page=student/addstudent');
return;
}
if(strlen($_POST['l_name'])<1)
{
$_SESSION['error']='Please enter last name';
header('Location:addstudent.php');
return;
}
if(strlen($_POST['gender'])<1)
{
$_SESSION['error']='Please enter gender';
header('Location:addstudent.php');
return;
}
if(strlen($_POST['dob'])<1)
{
$_SESSION['error']='Please select date';
header('Location:addstudent.php');
return;
}
if(strlen($_POST['blood'])<1)
{
$_SESSION['error']='Please enter blood group';
header('Location:addstudent.php');
return;
}
if(strlen($_POST['religion'])<1)
{
$_SESSION['error']='Please enter religion';
header('Location:addstudent.php');
return;
}
if(strlen($_POST['email'])<1)
{
$_SESSION['error']='Please enter email';
header('Location:addstudent.php');
return;
}
else if(!strpos($_POST['email'],"#")>0)
{
$_SESSION['error']='Please enter valid email';
header('Location:addstudent.php');
return;
}
if(strlen($_POST['address'])<1)
{
$_SESSION['error']='Please Address';
header('Location:addstudent.php');
return;
}
if(is_numeric($_POST['phone'])!=1)
{
$_SESSION['error']='Please enter valid phone no';
header('Location:addstudent.php');
return;
}
else
{
$stmpt=$pdo->prepare('INSERT INTO student_detail (f_name ,l_name ,gender, dob, blood_grp, religion, email, phone, address)
VALUES ( :fn , :ln , :sx , :dob , :bld , :re , :em , :phno , :add )');
$stmpt->execute(array(
':fn'=>$_POST['f_name'],
':ln'=>$_POST['l_name'],
':sx'=>$_POST['gender'],
':dob'=>$_POST['dob'],
':bld'=>$_POST['blood'],
':re'=>$_POST['religion'],
':em'=>$_POST['email'],
':phno'=>$_POST['phone'],
':add'=>$_POST['address']
));
$_SESSION['success']='Profile added';
header("Location: addstudent.php");
return;
}
}
}
ob_end_flush();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="../student/css/addstudent.css">
</head>
<body>
<div class="container-student-3">
<div class="page-info">
<h3>Student Form</h3>
<p>Home>Student Admit form</p>
</div>
<div class="server-message">
<?php
if(isset($_SESSION['error']))
{
echo '<p style="color:red";>'.$_SESSION['error'].'</p>';
unset($_SESSION['error']);
}
if(isset($_SESSION['success']))
{
echo '<p style="color:green";>'.$_SESSION['success'].'</p>';
unset($_SESSION['success']);
}
?>
</div>
<div class="student-form-wrap">
<div class="student-form-content">
<h3>Add New Student</h3>
<form method="post">
<div class="form-inputs">
<div class="col-xl-3 col-lg-6 col-12 form-group">
<label>First Name *</label>
<input type="text" placeholder="First Name" name="f_name" class="form-control">
</div>
<div class="col-xl-3 col-lg-6 col-12 form-group">
<label>Last Name *</label>
<input type="text" placeholder="Last Name" name="l_name" class="form-control">
</div>
<div class="col-xl-3 col-lg-6 col-12 form-group">
<label>Gender *</label>
<input type="text" placeholder="Gender" name="gender" class="form-control">
</div>
<div class="col-xl-3 col-lg-6 col-12 form-group">
<label>Date Of Birth *</label>
<input type="date" placeholder="Date of Birth" name="dob" class="form-control">
</div>
<div class="col-xl-3 col-lg-6 col-12 form-group">
<label>Blood Group *</label>
<input type="text" placeholder="Blood Group" name="blood" class="form-control">
</div>
<div class="col-xl-3 col-lg-6 col-12 form-group">
<label>Religion *</label>
<input type="text" placeholder="Religion" name="religion" class="form-control">
</div>
<div class="col-xl-3 col-lg-6 col-12 form-group">
<label>E-Mail *</label>
<input type="text" placeholder="E-male" name="email" class="form-control">
</div>
<div class="col-xl-3 col-lg-6 col-12 form-group">
<label>Address *</label>
<input type="text" placeholder="Address" name="address" class="form-control">
</div>
<div class="col-xl-3 col-lg-6 col-12 form-group">
<label>Phone *</label>
<input type="text" placeholder="Phone No" name="phone" class="form-control">
</div>
<div class="col-12 form-group mg-t-8">
<input type="submit" value="submit" name="submit">
<input type="reset" value="Reset" id="reset">
</div>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
This error is displayed when the "header" method is called more than once in an execution scope.
Let's see there, in your code there are several "if" conditions, without the "else if" treatment and somehow a "header" may be being executed more than once.
I would recommend doing the form treatments in a "Controller" or in another file, if you prefer. But as the top friend commented, you can test by replacing "return" with "exit".
Remember that "header" must be called before any real output is sent, either by normal HTML tags, blank lines in a file, or by PHP.
I have been trying to make a website. It is an online shopping website.
This is my code-
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Books And Beyond</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Bootstrap styles open source -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" crossorigin="anonymus">
<!-- Customize styles -->
<link href="style.css" rel="stylesheet"/>
<!-- font awesome styles open source -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymus">
<!-- Favicons -->
<link rel="shortcut icon" href="/favicon.ico">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style
type="text/css">
<!--
body {
background-image: url(assets/img/background.jpg);
}
-->
</style></head>
<body>
<!--
Upper Header Section
-->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="topNav">
<div class="container">
<div class="alignR">
<?php if (isset($_SESSION['email'])) { echo $_SESSION['email']; } else { ?>
<ul class="nav pull-right">
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#"><span class="icon-lock"></span> Login <b class="caret"></b></a>
<div class="dropdown-menu">
<form class="form-horizontal loginFrm" action="checkuser.php" method="post">
<div class="control-group">
<input name="email" type="text" class="span2" id="email" placeholder="Email">
</div>
<div class="control-group">
<input name="password" type="password" class="span2" id="password" placeholder="Password">
</div>
<div class="control-group">
<label class="checkbox">
<input type="checkbox"> Remember me
</label>
<button name="login" type="submit" class="shopBtn btn-block">Sign in</button>
</div>
</form>
</div>
</li>
</ul>
<?php } ?>
<?php if (isset($_SESSION['email'])) { ?>
Logout
<?php } else { ?>
<span class="icon-edit"></span> Register
<?php }?>
</div>
</div>
</div>
</div>
<!--
Lower Header Section
-->
<div class="container">
<div id="gototop"> </div>
<header id="header">
<div class="row">
<div class="span4">
<h1>
<a class="logo" href="index.php"><span>Books And Beyond</span>
<img src="assets/img/logo1.jpg" alt="" width="218" height="94"> </a> </h1>
</div>
</div>
</header>
<!--
Navigation Bar Section
-->
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<div class="nav-collapse">
<ul class="nav">
<li class="active">Home</li>
<li class="">About</li>
<li class="">Bargain Books</li>
<li class="">New Releases</li>
<li class="">Bestsellers</li>
<li class="">Contact Us</li>
</ul>
<ul class="nav pull-right">
</ul>
</div>
</div>
</div>
</div>
<div class="row">
<div class="span12">
<img src="assets/img/banner.jpg"/>
<hr class="soften"/>
</div>
</div>
<!--Body Section
-->
<div class="row">
<div id="sidebar" class="span3">
<div class="well well-small">
<h3> Category </h3>
<ul class="nav nav-list">
<li><span class="icon-chevron-right"></span>Fiction</li>
<li><span class="icon-chevron-right"></span>Non-Fiction</li>
<li><span class="icon-chevron-right"></span>Young Adult</li>
<li><span class="icon-chevron-right"></span>Children's</li>
<li><span class="icon-chevron-right"></span>Travel</li>
<li><span class="icon-chevron-right"></span>Education</li>
<li style="border:0"> </li>
</ul>
</div>
<!--<div class="well well-small alert alert-warning cntr">
<h2>50% Discount</h2>
<p>
only valid for online order. <br><br><a class="defaultBtn" href="#">Click here </a>
</p>
</div>-->
<!-- <div class="well well-small" ><img src="assets/img/paypal.jpg" alt="payment method paypal"></div>-->
<!--<a class="shopBtn btn-block" href="#">Upcoming products <br><small>Click to view</small></a>-->
<ul class="nav nav-list promowrapper">
<?php
/* require_once('dbconnect.php'); */
$result = mysql_query("SELECT * from product WHERE brand='accessories'");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
$price=$row["productprice"];
$productimage=$row["productimage"];
?>
<li>
<div class="thumbnail">
<img width="200" height="80" src="getImage.php?intproductid=<?php print $intproductid;?>" />
<div class="caption">
<table width="250" border="0">
<tr>
<td align="left" valign="middle"><form action="product_detail.php" method="post" name="form2" id="form2">
<label>
<input type="hidden" name="intproductid2" value="<?php echo $intproductid; ?>" />
<input name="Submit2" type="submit" class="shopBtn" value="View" />
</label>
</form></td>
<td align="right" valign="middle"><h4> <span class="pull-right"><?php echo $price; ?>.00</span></h4></td>
</tr>
</table>
</div>
</div>
</li>
<li style="border:0"> </li>
<?php } ?>
</ul>
</div>
<div class="span9">
<!--
New Products
-->
<div class="well well-small">
<h3>New Products </h3>
<hr class="soften"/>
<div class="row-fluid">
<div id="newProductcar" class="carousel slide">
<div class="">
<div class="item active">
<ul class="thumbnails">
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='bousni' LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
//$productimage=$row["productimage"];
?>
<li class="span3">
<div class="thumbnail">
<img width="200" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
</div>
</li>
<?php } ?>
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='hela couture' LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
//$productimage=$row["productimage"];
?>
<li class="span3">
<div class="thumbnail">
<img width="200" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
</div>
</li>
<?php } ?>
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='zey' LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
//$productimage=$row["productimage"];
?>
<li class="span3">
<div class="thumbnail">
<img width="200" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
</div>
</li>
<?php } ?>
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='AL-JUMAIRA' LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
//$productimage=$row["productimage"];
?>
<li class="span3">
<div class="thumbnail">
<img width="200" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
</div>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="well well-small">
<div class="span8">
<div class="row-fluid">
<h3>Features Products </h3>
<hr class="soften"/>
<ul class="thumbnails">
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='roza' LIMIT 3");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
$productname=$row["productname"];
$brand=$row["brand"];
$price=$row["productprice"];
$productimage=$row["productimage"];
?>
<li class="span4">
<div class="thumbnail">
<img width="250" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
<div class="caption cntr">
<p style="color:#990033"><?php echo $productname; ?></p>
<p><?php echo $brand; ?></p>
<p><strong>SAR <?php echo $price; ?>.00</strong></p>
<div class="btn-group">
<form id="form2" name="form2" method="post" action="product_detail.php">
<label>
<input type="hidden" name="intproductid2" value="<?php echo $intproductid; ?>" />
<input name="Submit2" type="submit" class="shopBtn" value="View" />
<input name="Submit2" type="submit" class="defaultBtn" value="Add to cart" />
</label>
</form>
</div>
<br class="clr">
</div>
</div>
</li>
<?php } ?>
</ul>
<hr class="soften"/>
<ul class="thumbnails">
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='haya' LIMIT 3");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
$productname=$row["productname"];
$brand=$row["brand"];
$price=$row["productprice"];
$productimage=$row["productimage"];
?>
<li class="span4">
<div class="thumbnail">
<img width="250" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
<div class="caption cntr">
<p style="color:#990033"><?php echo $productname; ?></p>
<p><?php echo $brand; ?></p>
<p><strong>SAR <?php echo $price; ?>.00</strong></p>
<div class="btn-group">
<form id="form2" name="form2" method="post" action="product_detail.php">
<label>
<input type="hidden" name="intproductid2" value="<?php echo $intproductid; ?>" />
<input name="Submit2" type="submit" class="shopBtn" value="View" />
<input name="Submit2" type="submit" class="defaultBtn" value="Add to cart" />
</label>
</form>
</div>
<br class="clr">
</div>
</div>
</li>
<?php } ?>
</ul>
</div>
</div>
<div class="row">
</div>
</div>
</div></div></div>
<!--
Footer
-->
<footer class="footer" style="float: bottom;">
<div class="row-fluid">
<div class="span3">
<h5>ORDER SUPPORT</h5>
Store pickup<br>
Return and Refund<br>
</div>
<div class="span3">
<h5>PRODUCT SUPPORT</h5>
FAQs<br>
Inquiry<br>
</div>
<div class="span3">
<h5>COOPORATIVE INFO</h5>
Terms and Condition <br>
Contact us<br>
</div>
<div class="span3">
<h5>GET CONNECTED</h5>
About us <br>
Create Account<br>
</div>
</div>
</footer>
</div><!-- /container -->
<div class="copyright">
<div class="container">
<p class="pull-right"> </p>
<span>Copyright 2019, Fatimatuz Johura - s201403034- Jeddah (Ladies Branch);<br> Books And Beyond</span>
</div>
</div>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.easing-1.3.min.js"></script>
<script src="assets/js/jquery.scrollTo-1.4.3.1-min.js"></script>
<script src="assets/js/shop.js"></script>
</body>
</html>
The 'New Products' and the footer section is not coming and I cant figure out why. I dont have a webhost yet so I am using localhost for now. I have tried editing the code but whatever I do, it does not seem to work. If anyone can help, I would really appreciate it. Thank you.
On line 152 (new products is on line ~ 185[ish])
/* require_once('dbconnect.php'); */
$result = mysql_query("SELECT * from product WHERE brand='accessories'");
As I said in the comments you use this require_once('dbconnect.php'); multiple times when it should be only once at the top of your file.
The above code is the first occurrence I could find, and as it's commented out, that query is going to bomb out on you. Execution happens top to bottom and the first uncommitted occurrence of that is line 196[ish], which is way to late for that first query.
Also as I said in the comments
Try turning on Error reporting - error_reporting(-1); and ini_set('display_errors', '1'); put those right after the <?php tag
You can save yourself, and us a lot of time that way.
So in Summery,
Remove all of these require_once('dbconnect.php'); and then add just one after the opening <?php tag.
PS you can easily test this, by just commenting that first query out, or by uncommenting that first require_once.
I am having trouble connecting a database i have created in phpMyAdmin to my web page using PHP. I am pretty sure my code is correct in both the html and php files and my DB and table names are correct, but when i try to use the registration form, it does nothing. I am using jQuery mobile, so have tried it with and without the data-ajax="false" attribute to no avail. What am i missing here? Thanks for any answers :) I have included the relevant html and php code below, it is the register form in the register page I am trying to connect to the DB.
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1; minimum-scale=1;">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<link href="/projects/ibill_v3/css/mainstyles.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/register.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/login.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/home.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/record_session.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/viewsessions.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/email.css" rel="StyleSheet"/>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="script.js"></script>
<script type='text/javascript' src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
<script type='text/javascript'>
$(document).on('pageinit', function(){
$('#registerForm').validate({ // initialize the plugin
// rules & options
});
});
</script>
<script type='text/javascript'>
$(document).on('pageinit', function(){
$('.loginform').validate({ // initialize the plugin
// rules & options
});
});
</script>
</head>
<body>
<!--********************************REGISTER PAGE**********************************************-->
<!--****************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="register">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div>
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="registerform">
<h1>The iBill Invoicing App for Activity Instructors</h1>
<p>Register below</p>
<form data-ajax="false" method="POST" action="register.php" >
<ul>
<li>
<label for="username">Username</label>
<input type="text" name="username" id="username" class="required" minlength="5" placeholder="enter username (min-5 characters)">
</li>
<li>
<label for="firstname">Firstname</label>
<input type="text" name="firstname" id="firstname" class="required" minlength="5" placeholder="enter firstname">
</li>
<li>
<label for="username">Surname</label>
<input type="text" name="surname" id="surname" class="required" minlength="5" placeholder="enter surname">
</li>
<li>
<label for="email">Email</label>
<input type="email" name="email" id="email" class="required email" placeholder="yourname#email.com">
</li>
<li>
<label for="password">Password</label>
<input type="password" name="password" id="password" class="required" minlength="6" placeholder="enter password">
</li>
<li>
<label for="confirmpassword">Confirm Password</label>
<input type="password" name="confirmpassword" id="confirmpassword" class="required" minlength="6" placeholder="re-enter password">
</li>
<div id="registerbutton">
<input type="submit" value="Register">
</div>
</ul>
</form>
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************REGISTER PAGE**********************************************-->
<!--****************************************************************************************-->
<!--********************************LOGIN PAGE**********************************************-->
<!--****************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="login">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div>
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="loginform">
<form action="form.php" method="post">
<ul>
<li><label for="usermail">Email</label>
<input type="email" name="usermail" placeholder="yourname#email.com" class="required"></li>
<li><label for="password">Password</label>
<input type="password" name="password" placeholder="enter password" minlength="6"></li>
<li>
<div id="loginbutton">
<input type="submit" value="Login"></li>
</div>
<div id="registerbutton">
<input type="submit" value="Register"></li>
</div>
</ul>
</form>
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************LOGIN PAGE**********************************************-->
<!--****************************************************************************************-->
<!--********************************HOME PAGE**********************************************-->
<!--***************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="home">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div><!-- /header -->
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="maincontent">
<h1>The iBill Invoicing App for Activity Instructors</h1>
<p>iBill is a cross-platform app that allows you track and manage activity sessions on the go.</p>
<br>
<p>Record an activity session to get started!</p>
<div style="text-align:center">
Record a Session
</div>
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************FOOTER**********************************************-->
<!--********************************HOME PAGE**********************************************-->
<!--***************************************************************************************-->
<!--********************************RECORD SESSION PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="sessionrecord">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div><!-- /header -->
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="maincontent">
<h1>Record a session using the form below</h1>
<form method="post" action="" id="sessionRecord">
<fieldset>
<select name="typeofactivity" id="typeofactivity" data-native-menu="false">
<option>Type of Session</option>
<option value="surf">Surf</option>
<option value="coast">Coasteer</option>
<option value="bodyboard">Bodyboard</option>
<option value="climbing">Cornish Challenge</option>
</select>
</fieldset>
<fieldset>
<select name="employer" id="employer" data-native-menu="false">
<option>Employer</option>
<option value="nac">Newquay Activity Centre</option>
<option value="coastline">Coastline Coasteer</option>
</select>
</fieldset>
<form method="post" action="PHP HERE!">
<label for="datetime">Date and Time of Session</label>
<input type="datetime-local" data-clear-btn="false" name="datetime" id="datetime" value="">
</form>
<form method="post" action="PHP HERE!">
<label for="amount">Amount (GBP)</label>
<input type="number" data-clear-btn="true" name="amount" id="amount" value="">
</form>
<div id="submitbutton">
<input type="submit" value="Submit">
</div>
</form>
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************FOOTER**********************************************-->
<!--********************************RECORD SESSION PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************VIEW SESSIONS PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="viewsessions">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div><!-- /header -->
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="maincontent">
<!--MAIN CONTENT GOES HERE-->
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************FOOTER**********************************************-->
<!--********************************VIEW SESSIONS PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************EMAIL AN INVOICE PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="email">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div><!-- /header -->
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="maincontent">
<!--MAIN CONTENT GOES HERE-->
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************FOOTER**********************************************-->
<!--********************************EMAIL AN INVOICE PAGE************************************-->
<!--***************************************************************************************-->
</body>
<?php
$servername = "localhost";
$username = "root";
$password = "cornwall";
$con=mysqli_connect('localhost','root','cornwall','ibill');
// This code creates a connec'tion to the MySQL database in PHPMyAdmin named 'ibill':
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// The connection is then checked, if it fails, an echo is sent back to the page stating a connection error.
$username = $_POST['username'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$emailaddress = $_POST['emailaddress'];
$password = $_POST['password'];
$confirmpassword = $_POST['confirmpassword'];
//These are the different PHP variables that store my posted data.
$register="INSERT INTO user_details (username, firstname, surname, emailaddress, password,) VALUES ('$username', '$firstname', '$surname', '$emailaddress', '$password')";
echo $register;
$result=mysqli_query($con, $register);
//This is the query that will be sent to the MySQL server.
header('Location: http://localhost/projects/ibill_v3/html/main.html#login');
exit();
//This directs the user to the relevant page after successful registration.
?>
First of all, read this article about SQL injection: How can I prevent SQL injection in PHP?.
There is an error in you SQL query. In your PHP file, replace this line:
$result=mysqli_query($con, $register);
with this:
if(mysqli_query($con,$register) === FALSE){
echo mysqli_error($con);
}
To display errors in PHP code, add these lines:
/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
Ref: How do I get PHP errors to display?
I am having trouble into finding the correct </vb:if> to to delete for the <vb:if condition="$show['member']"> condition. Sadly notepad++ couldn't locate the </vb:if> delete.My aim here is just to remove that if statement.
Here is the full code
<vb:if condition="$show['guest']">
<div class="guestwarn">
Hello Guest, if you reading this it means you have not yet registered. Please take a second to Click here to register and in a few simple steps, you will be able to enjoy all the features of our fine community. Register Now
</div>
</vb:if>
<vb:if condition="$show['member']">
<div id="pageWrapper"><div class="pageWrap">
<div id="topBar">
<div class="loginBox">
<div id="toplinks" class="toplinks">
<ul class="isuser">
<li>{vb:rawphrase log_out}</li>
<li>{vb:rawphrase user_control_panel}</li>
<li>{vb:rawphrase your_profile}</li>
<vb:if condition="$notifications_total">
<li class="popupmenu notifications" id="notifications">
<a class="popupctrl" href="usercp.php{vb:raw session.sessionurl_q}">{vb:rawphrase your_notifications}: <span class="notifications-number"><strong>{vb:raw notifications_total}</strong></span></a>
<ul class="popupbody popuphover">
{vb:raw notifications_menubits}
</ul>
</li>
<vb:else />
<li class="popupmenu nonotifications" id="nonotifications">
<a class="popupctrl" href="usercp.php{vb:raw session.sessionurl_q}">{vb:rawphrase your_notifications}</a>
<ul class="popupbody popuphover">
<li>{vb:rawphrase no_new_messages}</li>
<vb:if condition="$show['pmmainlink']"><li>{vb:rawphrase inbox}</li></vb:if>
</ul>
</li>
</vb:if>
<li class="welcomelink">{vb:rawphrase welcome_x_link_y, {vb:raw bbuserinfo.username}, {vb:link member, {vb:raw bbuserinfo}}}</li>
<vb:if condition="$vboptions['enablefacebookconnect']">
{vb:raw facebook_header}
</vb:if>
</ul>
{vb:raw template_hook.header_userinfo}
<vb:comment><p>{vb:rawphrase last_visited_x_at_y, {vb:raw pmbox.lastvisitdate}, {vb:raw pmbox.lastvisittime}}</p></vb:comment>
</div>
<vb:else />
<div class="loginLeft">
<!-- login form -->
<script type="text/javascript" src="clientscript/vbulletin_md5.js?v={vb:raw vboptions.simpleversion}"></script>
<form id="navbar_loginform" action="login.php?{vb:raw session.sessionurl}do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, {vb:raw show.nopasswordempty})">
<ul>
<li><div class="userBoxInput"><input type="text" class="loginInput<vb:if condition="!$username"> default-value</vb:if>" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="<vb:if condition="$username">{vb:raw username}<vb:else />{vb:rawphrase username}</vb:if>" /></div></li>
<li><div class="passBoxInput"><input type="password" class="loginInput" tabindex="102" name="vb_login_password" id="navbar_password" size="10" />
<input type="text" class="loginInput default-value" tabindex="102" name="vb_login_password_hint" id="navbar_password_hint" size="10" value="{vb:rawphrase password}" style="display:none;" /></div></li>
<li class="rememberMe"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser_navbar" class="cb_cookieuser_navbar" accesskey="c" tabindex="103" /> {vb:rawphrase remember_me}</label></li>
<li class="loginButton"><input type="image" src="{vb:stylevar imgdir_themedir}/loginButton.png" tabindex="104" value="{vb:rawphrase log_in}" title="{vb:rawphrase enter_username_to_login_or_register}" accesskey="s" /></li>
</ul>
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</form>
<script type="text/javascript">
YAHOO.util.Dom.setStyle('navbar_password_hint', "display", "inline");
YAHOO.util.Dom.setStyle('navbar_password', "display", "none");
vB_XHTML_Ready.subscribe(function()
{
//
YAHOO.util.Event.on('navbar_username', "focus", navbar_username_focus);
YAHOO.util.Event.on('navbar_username', "blur", navbar_username_blur);
YAHOO.util.Event.on('navbar_password_hint', "focus", navbar_password_hint);
YAHOO.util.Event.on('navbar_password', "blur", navbar_password);
});
function navbar_username_focus(e)
{
//
var textbox = YAHOO.util.Event.getTarget(e);
if (textbox.value == '<vb:if condition="$username">{vb:raw username}<vb:else />{vb:rawphrase username}</vb:if>')
{
//
textbox.value='';
textbox.style.color='{vb:stylevar input_color}';
}
}
function navbar_username_blur(e)
{
//
var textbox = YAHOO.util.Event.getTarget(e);
if (textbox.value == '')
{
//
textbox.value='<vb:if condition="$username">{vb:raw username}<vb:else />{vb:rawphrase username}</vb:if>';
textbox.style.color='{vb:stylevar shade_color}';
}
}
function navbar_password_hint(e)
{
//
var textbox = YAHOO.util.Event.getTarget(e);
YAHOO.util.Dom.setStyle('navbar_password_hint', "display", "none");
YAHOO.util.Dom.setStyle('navbar_password', "display", "inline");
YAHOO.util.Dom.get('navbar_password').focus();
}
function navbar_password(e)
{
//
var textbox = YAHOO.util.Event.getTarget(e);
if (textbox.value == '')
{
YAHOO.util.Dom.setStyle('navbar_password_hint', "display", "inline");
YAHOO.util.Dom.setStyle('navbar_password', "display", "none");
}
}
</script>
<!-- / login form -->
</div>
<vb:if condition="$vboptions['enablefacebookconnect']">
<div class="loginLeft">
<ul>
{vb:raw facebook_header}
</ul>
</div>
</vb:if>
</vb:if>
</div>
<vb:if condition="$vbulletin->options['display_social_icons']==1">
<div class="socialBox">
<vb:if condition="$vbulletin->options['facebook_account']"><img src="{vb:stylevar imgdir_themedir}/iconFacebook.png" alt="Follow us on Facebook" /></vb:if>
<vb:if condition="$vbulletin->options['twitter_account']"><img src="{vb:stylevar imgdir_themedir}/iconTwitter.png" alt="Follow us on Twitter" /></vb:if>
<vb:if condition="$vbulletin->options['linkedin_account']"><img src="{vb:stylevar imgdir_themedir}/iconLinkedin.png" alt="Linked In" /></vb:if>
<vb:if condition="$vbulletin->options['flickr_account']"><img src="{vb:stylevar imgdir_themedir}/iconFlickr.png" alt="Flickr" /></vb:if>
<vb:if condition="$vbulletin->options['youtube_account']"><img src="{vb:stylevar imgdir_themedir}/iconYoutube.png" alt="Watch us on YouTube" /></vb:if>
<vb:if condition="$vbulletin->options['myspace_account']"><img src="{vb:stylevar imgdir_themedir}/iconMyspace.png" alt="My Space" /></vb:if>
<vb:if condition="$vbulletin->options['blogger_account']"><img src="{vb:stylevar imgdir_themedir}/iconBlogger.png" alt="Blogger" /></vb:if>
</div>
</vb:if>
</div>
<div class="above_body"> <!-- closing tag is in template navbar -->
<div id="header" class="floatcontainer doc_header">
<div id="headerBox">
<vb:if condition="$stylevar['titleimage']"><a name="top" href="{vb:link forumhome}" id="logo"><img src="{vb:stylevar titleimage}" alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" /></a></vb:if>
</div>
I did go through other similar topics and still was unable to solve my problem.
The following is my form code.
<div id="footer-left">
<div id="subscribe">
<form action="subscribe.php" method="post">
<input type="text" name="name" value="Enter Your Name"/>
<input type="text" name="email" value="Enter Your Email"/>
<input type="submit" value="Subscribe">
</form>
</div>
</div>
And the following my css code.
#subscribe {
z-index:5;
}
#footer-left {
position:relative;
float:left;
bottom:0px;
width:40%;
height:350px;
background:#f0f0f0;
padding-right:2%;
padding-left:5%;
padding-top:50px;
}
And-index-5 is highest among all classes and identifiers. Still my text area is not clickable.
I know I must be missing some small point but unable to know what it is.
And help would be highly appreciated.
Thanks.
Updated to reflect the solution. In the original Fiddle posted in the comments, the z-index of the footer pane was -2. This was affecting the child elements as well. The form is now clickable after changing the z-index here to 3 as shown in the CSS below. Full code is on the jsfiddle.
http://jsfiddle.net/cpTZT/2/
HTML
<body onload="scaleImage()">
<div id="map_header" class="expressWay">
<div id="header_tabs">
<div id="header_left">
<div id="logo_banner"></div>
<div id="logo"><img src="./images/logo-text.png" style="width:100%;height:100%;" />
</div>
<div id="tabs">
<ul class="nav">
<li id="city"><span>City</span>
<div class="dropDown">
<div class="column" style="margin-left:0px"> Bangalore
Chennai
Delhi
Mumbai
Hyderabad
Jaipur
</div>
</div>
</li>
</ul>
</div>
<div class="clear"></div>
</div>
<div id="header_right">
<div id="social_links">
</div> Sign In
<img class="dots" src="./images/dots.png" align="center" style="display:inline-block;float:right;margin-right:40px;margin-top:10px;" />
<li id="partner"><span>Partner With Us</span>
</li>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</div>
<div id="content"></div>
<div id="footer">
<div id="footer-left">
<div id="subscribe">
<form action="subscribe.php" method="post">
<input type="text" name="name" placeholder="Enter Your Name" />
<input type="text" name="email" placeholder="Enter Your Email" />
<input type="submit" value="Subscribe">
</form>
</div>
</div>
<div id="footer-right-left">
<ul>
<li><b>COMPANY</b>
</li>
<li>About Us</li>
<li>Careers</li>
<li>Legal</li>
<li>Terms & Conditions</li>
<li>Press/Publications</li>
</ul>
</div>
<div id="footer-right-right">
<ul>
<li><b>CONTACT US</b>
</li>
<li>Street No XYX Locality City State,Pincode</li>
<li>query#ananas.in</li>
<li>+91-xxxxxxxxxx</li>
</ul>
</div>
</div>
CSS
#footer {
position:relative;
z-index:3;
font-size:0.8em;
}
The area was clickable when I put the original code on JS Fiddle, but when you typed, the text did not disappear.
EDIT: Fixed the information to properly address the question.