Hello I have a query with while loop which is used for retrieving data but in here my query
along my while loop is in top of page so its repeating other elements specifically my
header.
Here is the code:
<?php
require_once('../Admin Panel/db.php');
if(!empty($_POST['Province']) && !empty($_POST['District']) && !empty($_POST['radio']))
{
$provincename=$_POST['Province'];
$districtname=$_POST['District'];
$propertystatus=$_POST['radio'];
$query = "SELECT
properties.PropertyID,
properties.PropertyType,
properties.PropertyDealType,
properties.PropertyRegion,
properties.PropostedPrice,
properties.DealStatus,
properties.CurrencyType,
propertyimages.ImageID,
propertyimages.ImagePath,
propertyimages.ImageName,
provinces.ProvinceName,
districts.DistrictName,
pds.PDName
FROM properties, provinces, districts, pds, propertyimages
WHERE provinces.ProvinceID=properties.ProvinceID
AND districts.DistrictID=properties.DistrictID
AND pds.PDID=properties.PDID
AND properties.ImageID=propertyimages.ImageID
AND properties.Status= 'Active'
AND properties.propertyStatus = 'APPROVED'
AND ProvinceName='".$provincename."'
AND DistrictName='".$districtname."'
AND PropertyDealType='".$propertystatus."'
GROUP BY properties.PropertyID";
$queryrun= $connection->query($query); // The query run in here
if( $connection->error ) exit( $connection->error ); // In here checks for the errors which may occure in our query
while ($row= $queryrun->fetch_assoc()) // storing the value of the query into the variable of row
{
$count= $queryrun->num_rows; // Taking the number of queries returened by the result
?>
<!DOCTYPE html>
<html>
<head>
<LINK REL="SHORTCUT ICON" HREF="favico.ico">
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content=" spdealers Onlince Dealing," />
<meta name="Keywords" content="spdealers.com - spdealers, Property spdealers, Property spdealers, real estate Afghanistan, Afghanistan property, Afghanistan properties, property in Afghanistan, property Afghanistan, Afghanistan real estate, apartments, properties for sale Afghanistan, office space, property, buy property, sell property, rent property, commercial real estate Afghanistan, Afghanistan properties, Afghanistan properties on sale, Afghanistan property portals, Afghanistan residential real estate, rental property, flats, apartments, studio apartments, property site,makaan, makan, spdealers.com, real estate properties, Afghanistan real estate, real estate Afghanistan, property Afghanistan, Afghanistan property portal, buy property, sell property, rent property online, flats, apartments, studio apartment, rental property, commercial real estate, search property, list property, post requirement, featured builders, dealers, property index, properties in Afghanistan, property by localityProperty, Properties, Property For Sale, Find a Property, Properties for sale, Real Estate, Buy real estate. R">
<Meta name="description" content="spdealers Online Property Dealing In Afghansitan, Property Search, buy, sell, rent, lease residential, commercial propertys only on spdealers.com.">
<title>SPDealers</title>
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="logo">
<img src="images/logo.png" alt="" />
</div>
<ul>
<li class="selected"><span>PROPERTY</span></li>
<li>View Option</li>
<li><span>HOME</span></li>
</ul>
</div>
<div id="body">
<div class="header">
<div>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
<div>
<p>Do you want to earn money and have a good income? Do you want to receive money without working hours and putting pressure over your Mind, So Please contact with us and make yourself one of our valuable Remote Employee Click Here for more information.</p>
</div>
<div id="threeimages">
<img src="images/flags.png">
<img src="images/graph.png">
</div>
</div>
</div>
<br>
<div class="footer">
<div class="featured">
<div class="propertywrapperviewmore">
<div class="propertysingleimageviewmore">
<a href="property.php?ImageID=<?php echo $row['ImageID'] ?>">
<img src="../Admin Panel/Property_Insertion_Files/<?php echo $row['ImagePath'] ?>" width="227" height="147" alt="<?php echo $row['ImageName'] ?>" style="border-radius:8px;" ></a>
</div>
<div class="propertyIDviewmorelablevalue">
<div class="propertyIDL">Property ID:</div>
<div class="propertyIDV"><?php echo $row['PropertyID']?></div>
<div align="right" style="
width:310px;
height:15px;
font-size:20px;
float:right;
padding-bottom:5px;
background-color:#000;
color:#FFF;
"><marquee behavior="scroll" scrollamount="2" onMouseover="this.scrollAmount=1" onMouseout="this.scrollAmount=6"><?php echo $row['PropertyDealType'] ?></marquee></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Property Type:</div>
<div class="propertyothersV"><?php echo $row['PropertyType']?></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Address:</div>
<div class="propertyothersV"><?php echo $row['PropertyRegion'].' / Nahya: '.$row['PDName'].' / District: '.$row['DistrictName'].' / '.$row['ProvinceName']?></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Total Price:</div>
<div class="propertyothersV"><?php $price = (isset($row['PropostedPrice']) && $row['PropostedPrice']!='')?
number_format($row['PropostedPrice'], 2, '.', ','):'';
echo $row['CurrencyType'].' '.$price?></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Deal Status:</div>
<div class="propertyothersV"><?php echo $row['DealStatus']?></div>
</div>
<br><br><br><br>
<div class="propertysviewmoreDescription">
<div class="propertysviewmoreDescriptionL">Description:</div>
<div class="propertysviewmoreDescriptionV">
To find out more this property, please click on the VIEW MORE button. You can contact us more specific information
on this property.
<label style="float:right;"><br>View More</label>
<div>
</div>
</div>
</div>
</div>
<?php
}
if($queryrun->num_rows == 0)
{
echo "<div style='margin-left:116px; line-height: 36px;'>".'Sorry there is no Record for Your search: '." ". "<br>
Province: <b>".$provincename."</b> <br>District: <b>". $districtname."</b>
<br> Property Status: <b>".$propertystatus."</b>
<br> to search other provinces and cities
<br>
<a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a>
</div>";
}
}
else
{
echo '<br><br>You Havent Selected The Following Properly:<br><br>
<strong>(Province)</strong> <br>
<strong>(District)</strong> <br>
<strong>(Property Status)</strong>.<br><br>';
echo "Please <a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a> to go back";
}
?>
</div>
<div id="ads" style="margin-left:844px;">
<div id="adsone"></div>
<div id="adsthree"></div>
</div>
</div>
</div>
<div id="footer">
<div id="bottomoptions">Home About Us Advertise With Us Terms&Condition Help&Support Privacy Policy FAQ Contact Us Report A Problem
<div id="copyright"><p>All rights Reserved©2014 spdealers.com</p>
</div>
</div>
</div>
</div>
</body>
</html>
I am only guessing where your loop is supposed to be and where your breaks should be on if else conditions. They should hopefully be close...??
<?php
require_once('../Admin Panel/db.php');
class ProvinceProp
{
protected $connection;
public function __construct($connection)
{
$this->connection = $connection;
}
public $provincename;
public $districtname;
public $propertystatus;
public $num_rows;
public function ProcessPost()
{
if(!empty($_POST['Province']) && !empty($_POST['District']) && !empty($_POST['radio'])) {
$this->provincename = $_POST['Province'];
$this->districtname = $_POST['District'];
$this->propertystatus = $_POST['radio'];
$query = "SELECT
properties.PropertyID,
properties.PropertyType,
properties.PropertyDealType,
properties.PropertyRegion,
properties.PropostedPrice,
properties.DealStatus,
properties.CurrencyType,
propertyimages.ImageID,
propertyimages.ImagePath,
propertyimages.ImageName,
provinces.ProvinceName,
districts.DistrictName,
pds.PDName
FROM properties, provinces, districts, pds, propertyimages
WHERE provinces.ProvinceID=properties.ProvinceID
AND districts.DistrictID=properties.DistrictID
AND pds.PDID=properties.PDID
AND properties.ImageID=propertyimages.ImageID
AND properties.Status= 'Active'
AND properties.propertyStatus = 'APPROVED'
AND ProvinceName='".$this->provincename."'
AND DistrictName='".$this->districtname."'
AND PropertyDealType='".$this->propertystatus."'
GROUP BY properties.PropertyID";
// The query run in here
$queryrun = $this->connection->query($query);
// In here checks for the errors which may occure in our query
if( $this->connection->error )
exit( $this->connection->error );
$this->num_rows = $queryrun->num_rows;
// storing the value of the query into the variable of row
while ($res = $queryrun->fetch_assoc()) {
$array[] = $res;
}
// Return array or return 0 (false)
return (isset($array))? $array: 0;
}
}
}
// Start instance, feed in database connection
$_property = new ProvinceProp($connection);
// See if there are rows returned (greater than or equal to 0) or empty
// Empty signifies that criteria to generate the sql was not satisfied
$array = $_property->ProcessPost();
?><!DOCTYPE html>
<html>
<head>
<LINK REL="SHORTCUT ICON" HREF="favico.ico">
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content=" spdealers Onlince Dealing," />
<meta name="Keywords" content="spdealers.com - spdealers, Property spdealers, Property spdealers, real estate Afghanistan, Afghanistan property, Afghanistan properties, property in Afghanistan, property Afghanistan, Afghanistan real estate, apartments, properties for sale Afghanistan, office space, property, buy property, sell property, rent property, commercial real estate Afghanistan, Afghanistan properties, Afghanistan properties on sale, Afghanistan property portals, Afghanistan residential real estate, rental property, flats, apartments, studio apartments, property site,makaan, makan, spdealers.com, real estate properties, Afghanistan real estate, real estate Afghanistan, property Afghanistan, Afghanistan property portal, buy property, sell property, rent property online, flats, apartments, studio apartment, rental property, commercial real estate, search property, list property, post requirement, featured builders, dealers, property index, properties in Afghanistan, property by localityProperty, Properties, Property For Sale, Find a Property, Properties for sale, Real Estate, Buy real estate. R">
<Meta name="description" content="spdealers Online Property Dealing In Afghansitan, Property Search, buy, sell, rent, lease residential, commercial propertys only on spdealers.com.">
<title>SPDealers</title>
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
</head>
<body>
<div id="wrapper">
<?php
// I am only guessing where conditions are met so display required....
if(isset($_property->provincename)) { ?>
<!--start header class -->
<div id="header">
<div id="logo"><img src="images/logo.png" alt="" /></div>
<ul>
<li class="selected"><span>PROPERTY</span></li>
<li>View Option</li>
<li><span>HOME</span></li
</ul>
</div>
<!--start body class -->
<div id="body">
<div class="header">
<div>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
<div>
<p>Do you want to earn money and have a good income? Do you want to receive money without working hours and putting pressure over your Mind, So Please contact with us and make yourself one of our valuable Remote Employee Click Here for more information.</p>
</div>
<div id="threeimages">
<img src="images/flags.png">
<img src="images/graph.png">
</div>
</div>
</div>
<div class="footer">
<div class="featured"><?php
// If the array was returned (ie rows were returned from db)
if(is_array($array)) {
// Here is the start of the loop where I am guessing it would be...??
foreach($array as $row) { ?>
<div class="propertywrapperviewmore">
<div class="propertysingleimageviewmore">
<a href="property.php?ImageID=<?php echo $row['ImageID'] ?>">
<img src="../Admin Panel/Property_Insertion_Files/<?php echo $row['ImagePath'] ?>" width="227" height="147" alt="<?php echo $row['ImageName'] ?>" style="border-radius:8px;" ></a>
</div>
<div class="propertyIDviewmorelablevalue">
<div class="propertyIDL">Property ID:</div>
<div class="propertyIDV"><?php echo $row['PropertyID']?></div>
<div align="right" style="width:310px; height:15px; font-size:20px; float:right; padding-bottom:5px; background-color:#000; color:#FFF;">
<marquee behavior="scroll" scrollamount="2" onMouseover="this.scrollAmount=1" onMouseout="this.scrollAmount=6"><?php echo $row['PropertyDealType'] ?></marquee>
</div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Property Type:</div>
<div class="propertyothersV"><?php echo $row['PropertyType']?></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Address:</div>
<div class="propertyothersV"><?php echo $row['PropertyRegion'].' / Nahya: '.$row['PDName'].' / District: '.$row['DistrictName'].' / '.$row['ProvinceName']?></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Total Price:</div>
<div class="propertyothersV">
<?php $price = (isset($row['PropostedPrice']) && $row['PropostedPrice']!='')? number_format($row['PropostedPrice'], 2, '.', ','):'';
echo $row['CurrencyType'].' '.$price?></div>
</div>
<div class="propertysviewmoreotherlablevalue" style="margin-bottom: 60px;">
<div class="propertyothersL">Deal Status:</div>
<div class="propertyothersV"><?php echo $row['DealStatus']?></div>
</div>
<div class="propertysviewmoreDescription">
<div class="propertysviewmoreDescriptionL">Description:</div>
<div class="propertysviewmoreDescriptionV">To find out more this property, please click on the VIEW MORE button. You can contact us more specific information on this property.
<label style="float:right;"><br>View More</label>
<div>
</div>
</div>
<?php }
} ?>
</div>
</div>
<?php }
if(isset($_property->num_rows) && $_property->num_rows == 0) { ?>
<div style='margin-left:116px; line-height: 36px;'>Sorry there is no Record for Your search: <br>
Province: <b><?php echo $provincename; ?></b> <br>District: <b><?php echo $districtname; ?></b>
<br> Property Status: <b><?php echo $propertystatus; ?></b>
<br> to search other provinces and cities<br>
<a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a>
</div><?php
}
else { ?>
<br><br>You Havent Selected The Following Properly:<br><br>
<strong>(Province)</strong> <br>
<strong>(District)</strong> <br>
<strong>(Property Status)</strong>.<br><br>
Please <a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a> to go back<?php
} ?>
</div>
<div id="ads" style="margin-left:844px;">
<div id="adsone"></div>
<div id="adsthree"></div>
</div>
</div>
</div>
<div id="footer">
<div id="bottomoptions">Home About Us Advertise With Us Terms&Condition Help&Support Privacy Policy FAQ Contact Us Report A Problem
<div id="copyright"><p>All rights Reserved©2014 spdealers.com</p></div>
</div>
</div>
</div>
</body>
</html>
Your code is written in while loop you have to add only those tag that you want to repeat to full HTML code.
<HTML CODE>
<?php code
While loop
{
//php and html code combine
}
?>
<HTMl CODE>
Try this. my comments are in the capital letters so read them,
Breif Explanation: I removed the header tag from your while posted it above while loop and leave the note how you can place it. According to your need. and some other code i also posted it above the while loop.
But before reading the solution look the example how the while loop work
while($condition)
{
//repeat the code. In short it will reapeat the code untill the condition is true. Thanks
}
Thats your answer
<?php
require_once('../Admin Panel/db.php');
if(!empty($_POST['Province']) && !empty($_POST['District']) && !empty($_POST['radio']))
{
$provincename=$_POST['Province'];
$districtname=$_POST['District'];
$propertystatus=$_POST['radio'];
$query = "SELECT
properties.PropertyID,
properties.PropertyType,
properties.PropertyDealType,
properties.PropertyRegion,
properties.PropostedPrice,
properties.DealStatus,
properties.CurrencyType,
propertyimages.ImageID,
propertyimages.ImagePath,
propertyimages.ImageName,
provinces.ProvinceName,
districts.DistrictName,
pds.PDName
FROM properties, provinces, districts, pds, propertyimages
WHERE provinces.ProvinceID=properties.ProvinceID
AND districts.DistrictID=properties.DistrictID
AND pds.PDID=properties.PDID
AND properties.ImageID=propertyimages.ImageID
AND properties.Status= 'Active'
AND properties.propertyStatus = 'APPROVED'
AND ProvinceName='".$provincename."'
AND DistrictName='".$districtname."'
AND PropertyDealType='".$propertystatus."'
GROUP BY properties.PropertyID";
$queryrun= $connection->query($query); // The query run in here
if( $connection->error ) exit( $connection->error ); // In here checks for the errors which may occure in our query
//PUT YOUR HTTML CODE HERE WHICH YOU DONT WANT TO GET REPEATED.
//END THE PHP HERE
?>
<!DOCTYPE html>
<html>
<head>
<LINK REL="SHORTCUT ICON" HREF="favico.ico">
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content=" spdealers Onlince Dealing," />
<meta name="Keywords" content="spdealers.com - spdealers, Property spdealers, Property spdealers, real estate Afghanistan, Afghanistan property, Afghanistan properties, property in Afghanistan, property Afghanistan, Afghanistan real estate, apartments, properties for sale Afghanistan, office space, property, buy property, sell property, rent property, commercial real estate Afghanistan, Afghanistan properties, Afghanistan properties on sale, Afghanistan property portals, Afghanistan residential real estate, rental property, flats, apartments, studio apartments, property site,makaan, makan, spdealers.com, real estate properties, Afghanistan real estate, real estate Afghanistan, property Afghanistan, Afghanistan property portal, buy property, sell property, rent property online, flats, apartments, studio apartment, rental property, commercial real estate, search property, list property, post requirement, featured builders, dealers, property index, properties in Afghanistan, property by localityProperty, Properties, Property For Sale, Find a Property, Properties for sale, Real Estate, Buy real estate. R">
<Meta name="description" content="spdealers Online Property Dealing In Afghansitan, Property Search, buy, sell, rent, lease residential, commercial propertys only on spdealers.com.">
<title>SPDealers</title>
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="logo">
<img src="images/logo.png" alt="" />
</div>
<ul>
<li class="selected"><span>PROPERTY</span></li>
<!--ADDED THE HEADER HERE. YOU CAN PLACE IT WITH THE HELP OF YOUR CSS WHERE EVERY YOU WANT-->
<div class="header">
<div>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
<div>
<p>Do you want to earn money and have a good income? Do you want to receive money without working hours and putting pressure over your Mind, So Please contact with us and make yourself one of our valuable Remote Employee Click Here for more information.</p>
</div>
<div id="threeimages">
<img src="images/flags.png">
<img src="images/graph.png">
</div>
</div>
</div>
<?php
//BEFORE WHILE LOOP START AGAIN YOUR PHP
while ($row= $queryrun->fetch_assoc()) // storing the value of the query into the variable of row
{
$count= $queryrun->num_rows; // Taking the number of queries returened by the result
?>
<li>View Option</li>
<li><span>HOME</span></li>
</ul>
</div>
<div id="body">
<br>
<div class="footer">
<div class="featured">
<div class="propertywrapperviewmore">
<div class="propertysingleimageviewmore">
<a href="property.php?ImageID=<?php echo $row['ImageID'] ?>">
<img src="../Admin Panel/Property_Insertion_Files/<?php echo $row['ImagePath'] ?>" width="227" height="147" alt="<?php echo $row['ImageName'] ?>" style="border-radius:8px;" ></a>
</div>
<div class="propertyIDviewmorelablevalue">
<div class="propertyIDL">Property ID:</div>
<div class="propertyIDV"><?php echo $row['PropertyID']?></div>
<div align="right" style="
width:310px;
height:15px;
font-size:20px;
float:right;
padding-bottom:5px;
background-color:#000;
color:#FFF;
"><marquee behavior="scroll" scrollamount="2" onMouseover="this.scrollAmount=1" onMouseout="this.scrollAmount=6"><?php echo $row['PropertyDealType'] ?></marquee></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Property Type:</div>
<div class="propertyothersV"><?php echo $row['PropertyType']?></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Address:</div>
<div class="propertyothersV"><?php echo $row['PropertyRegion'].' / Nahya: '.$row['PDName'].' / District: '.$row['DistrictName'].' / '.$row['ProvinceName']?></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Total Price:</div>
<div class="propertyothersV"><?php $price = (isset($row['PropostedPrice']) && $row['PropostedPrice']!='')?
number_format($row['PropostedPrice'], 2, '.', ','):'';
echo $row['CurrencyType'].' '.$price?></div>
</div>
<div class="propertysviewmoreotherlablevalue">
<div class="propertyothersL">Deal Status:</div>
<div class="propertyothersV"><?php echo $row['DealStatus']?></div>
</div>
<br><br><br><br>
<div class="propertysviewmoreDescription">
<div class="propertysviewmoreDescriptionL">Description:</div>
<div class="propertysviewmoreDescriptionV">
To find out more this property, please click on the VIEW MORE button. You can contact us more specific information
on this property.
<label style="float:right;"><br>View More</label>
<div>
</div>
</div>
</div>
</div>
<?php
}
if($queryrun->num_rows == 0)
{
echo "<div style='margin-left:116px; line-height: 36px;'>".'Sorry there is no Record for Your search: '." ". "<br>
Province: <b>".$provincename."</b> <br>District: <b>". $districtname."</b>
<br> Property Status: <b>".$propertystatus."</b>
<br> to search other provinces and cities
<br>
<a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a>
</div>";
}
}
else
{
echo '<br><br>You Havent Selected The Following Properly:<br><br>
<strong>(Province)</strong> <br>
<strong>(District)</strong> <br>
<strong>(Property Status)</strong>.<br><br>';
echo "Please <a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a> to go back";
}
?>
</div>
<div id="ads" style="margin-left:844px;">
<div id="adsone"></div>
<div id="adsthree"></div>
</div>
</div>
</div>
<div id="footer">
<div id="bottomoptions">Home About Us Advertise With Us Terms&Condition Help&Support Privacy Policy FAQ Contact Us Report A Problem
<div id="copyright"><p>All rights Reserved©2014 spdealers.com</p>
</div>
</div>
</div>
</div>
</body>
</html>
Related
I'm making a website for my school and my website is like a laptop store and the main thing in my webpage is a product filter. I have made the product filter, it works great, but the problem is that I added shortcuts that send you to a single product page by clicking one of the products in the product filter. You can click on a product when you just came in the website and haven't messed with the product filter and it sends you to the single product page, but once you search for something using the filter the filtrated product cant be clicked on and you have to refresh the page to select your product. This is happening, because when you come in the website, you see index.php, but once you use the product filter, you are seeing action.php.
here is a part of my code from index.php:
<?php
$sql="SELECT * FROM Laptop";
$result=$conn->query($sql);
if ($result-> num_rows > 0) {
while($row=$result->fetch_assoc()){
$Laptop_ID = $row['Laptop_ID'];
?>
<?php echo "<a href='single_laptop.php?Laptop=" . $Laptop_ID ."'>" ?>
<div class="col-md-3 mb-2" style="color: blue">
<div class="card-deck">
<div class="card boarder-secondary">
<div class="card-img-overlay">
<h6 class="text-light bg-success text-center rounded p-1">
<?= $row['Nosaukums']; ?></h6>
</div>
<br>
<img src="<?= $row['Bilde']; ?>" class="card-img-top">
<div class="card-body">
<p>
Procesors : <?= $row['Procesors']; ?><br>
Videokarte : <?= $row['Videokarte']; ?><br>
RAM : <?= $row['RAM']; ?><br>
</p>
</div>
</div>
</div>
</div>
<?php }
}else {
echo "nav rezultātu";
}?>
</div>
</div>
</div>
And here is my action.php:
<?php
require 'dataB.php';
if(isset($_POST['action'])){
$sql = "SELECT * FROM Laptop WHERE Modelis !=''";
if(isset($_POST['Modelis'])){
$Modelis = implode("','", $_POST['Modelis']);
$sql .="AND Modelis IN('".$Modelis."')";
}
if(isset($_POST['Tips'])){
$Tips = implode("','", $_POST['Tips']);
$sql .="AND Tips IN('".$Tips."')";
}
if(isset($_POST['RAM'])){
$RAM = implode("','", $_POST['RAM']);
$sql .="AND RAM IN('".$RAM."')";
}
if(isset($_POST['Procesors'])){
$Procesors = implode("','", $_POST['Procesors']);
$sql .="AND Procesors IN('".$Procesors."')";
}
if(isset($_POST['Videokarte'])){
$Videokarte = implode("','", $_POST['Videokarte']);
$sql .="AND Videokarte IN('".$Videokarte."')";
}
$result = $conn->query($sql);
$output='';
if($result->num_rows>0){
while($row=$result->fetch_assoc()){
$output .='
<div class="col-md-3 mb-2" style="color: blue">
<div class="card-deck">
<div class="card boarder-secondary">
<div class="card-img-overlay">
<h6 class="text-light bg-success text-center rounded p-1">
'.$row['Nosaukums'].'</h6>
</div>
<br>
<img src="'.$row['Bilde'].'" class="card-img-top">
<div class="card-body">
<p>
Procesors : '.$row['Procesors'].'<br>
Videokarte : '.$row['Videokarte'].'<br>
RAM : '.$row['RAM'].'<br>
</p>
</div>
</div>
</div>
</div>';
}
} else {
$output = "<h3>No Products Found!<h3>";
}
echo $output;
}
?>
I need to figure out how to properly put the code from index.php, where it makes it possible to redirect me to single.laptop.php, to action.php, so I can redirect to single_laptop.php with no problems using the product filter.
$(document).keydown(function(e){
var keycode=e.keyCode;
if (keycode == 27)
{
$("#change").trigger('click');
}
});
$("#change").click(function() {
//do what you need
if($("#radio:checked").length==0)
{
alert("abc");
return false;
}
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#3.3.7/dist/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#3.3.7/dist/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
Press ESC
</body>
</html>
This week our product pages have been not working as intended. When clicking the product image thumbnail to enlarge, the lightbox window loads and just continues to load, never displaying the image. It was working before and I have no access to these scripts and files, since they are loaded through PHP that I have no access to. We are on BigCommerce's platform, but BC will not help me because we have customized our template. I have poured through the source code and cannot find what could be causing this issue. Any help is greatly appreciated.
Link to a product page: http://www.inflatableboats.net/demo-zodiac-pro-open-650-t-top-neo-2016-with-twin-yamaha-f70-four-stroke/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/">
%%Panel.HTMLHead%%
<body>
<script type="text/javascript" src="%%GLOBAL_AppPath%%/javascript/jquery/plugins/validate/jquery.validate.js?%%GLOBAL_JSCacheToken%%"></script>
<script type="text/javascript" src="%%GLOBAL_AppPath%%/javascript/product.functions.js?%%GLOBAL_JSCacheToken%%"></script>
<script type="text/javascript" src="%%GLOBAL_AppPath%%/javascript/product.js?%%GLOBAL_JSCacheToken%%"></script>
<div id="Container">
%%Panel.Header%%
<div id="Wrapper">
%%Panel.WrapperBanner%%
<div class="Left" id="LayoutColumn1">
%%Panel.SideCategoryList%%
%%Panel.SideNewProducts%%
%%Panel.SideNewsletterBox%%
%%Panel.SideLiveChatServices%%
</div>
<div class="Content" id="LayoutColumn2">
%%Panel.ProductBreadcrumb%%
%%Panel.ProductDetails%%
<div id="Fees">
<p id="FeeHeader"><strong>Standard Fees Apply</strong></p>
<a class="tooltip" style="float: left;" href="#"> PDI: <span> <img class="callout" src="http://inflatableboats.net/template/feebox/callout.gif" alt="" /> <strong>Pre-Delivery Inspection</strong><br /> Standard Fee for services performed and products used on each new vessel, requested by all manufacturers to validate and assist in all warranties.<br /><br />We install a deep cycle marine battery, fully rig steering components, complete electrical and systems check. We conduct a full system check on the motor, fill with oil, fluids, and fuel, then test run in a test tank.<br /><br />Once everything is tuned and prepared, a sea trial is performed with two Specialists to achieve ideal RPM-to-top-speed ratio, ensuring the boat gets on plane properly, and all systems operate on water.<br /><br />Afterwards a full detail is performed on the tubes, deck, and hull to be turn-key ready for the customer. </span> </a>
<p style="float: left;"> </p>
<a class="tooltip" style="float: left;" href="#"> Destination Fee: <span> <img class="callout" src="http://inflatableboats.net/template/feebox/callout.gif" alt="" /> <strong>Destination Fees are set by Zodiac.</strong><br /> Standard Fee both vehicle and vessel dealerships are charged from a manufacturer to ship product to dealerships </span> </a>
<p style="float: left;"> </p>
</div>
<div id="quote">
<a class="btn lightbox-40737220632144" style="cursor: pointer;"><img id="quotebutton" style="" src="http://inflatableboats.net/template/img/request-a-quote.png" name="quotebutton" /></a>
<img id="financebutton" style="" src="http://inflatableboats.net/template/img/finance-button.png" name="quotebutton" />
</div>
%%Panel.ProductTabs%%
%%Panel.ProductDescription%%
%%Panel.ProductVideos%%
%%Panel.ProductWarranty%%
%%Panel.ProductOtherDetails%%
%%Panel.SimilarProductsByTag%%
%%Panel.ProductByCategory%%
%%Panel.ProductVendorsOtherProducts%%
%%Panel.SimilarProductsByCustomerViews%%
</div>
<div class="Right" id="LayoutColumn3">
%%Panel.SideCurrencySelector%%
%%Panel.SideProductAddToWishList%%
%%Panel.SideProductRelated%%
%%Panel.SideProductRecentlyViewed%%
</div>
<br class="Clear" />
</div>
%%Panel.Footer%%
</div>
<script>
$(document).ready(function(){
$("#ProductOtherDetails .ProductDetailsGrid .DetailRow").each(function(){
var label = $(".Label",this).text();
if ( label === 'PDI:') {
var pdiAmount = $(".Value",this).text();
pdiAmount = pdiAmount.replace(/\t/g,"");
pdiAmount = pdiAmount.replace(/\n/g,"");
//console.log("PDI is " + pdiAmount);
$("#Fees p:nth-of-type(2)").text(pdiAmount);
}
if ( label === 'DF:') {
var dfiAmount = $(".Value",this).text();
dfiAmount = dfiAmount.replace(/\t/g,"");
dfiAmount = dfiAmount.replace(/\n/g,"");
//console.log("DF is " + dfiAmount);
$("#Fees p:nth-of-type(3)").text(dfiAmount);
}
})
});
</script>
<script src="https://form.jotform.com/static/feedback2.js?3.3.REV" type="text/javascript"> var JFL_40737220632144 = new JotformFeedback({ formId: '40737220632144', base: 'https://form.jotform.com/', windowTitle: 'Request a Quote', background: '#B10D13', fontColor: '#FFFFFF', type: 'false', height: 500, width: 700, openOnLoad: false }); </script>
</body>
</html>
I think that maybe it is caused by a TypeError, but do not know how I can fix this. Image linked below. It points me to the first line of the source, which is the HTML Doctype. That doesn't make sense to me.
I am trying to execute the following MySQL query:
SELECT event.event_id, venue.venue_name, venue.alt_venue_name, venue.venue_address1, venue.cross_street, dictionary_city.city_name, venue.zip, dictionary_filter.filter_name, venue.capacity, event.start_date, event.end_date, dictionary_barType.is_ob, dictionary_barType.barType_name, event.barType_time, event.is_food, event.food_type, event.food_time, dictionary_age.age_name, dictionary_age.age_description, event.ticketCo_id, event.ticket_locator, event.ticket_left, event_description.description, event_highlight.highlight, event.event_tag, event.image_flyer, event.image_flyer_310x425, event.image_2, event.image_2_310x208, event.image_3, event.image_3_310x208
FROM event
LEFT JOIN venue
ON venue.venue_id=event.venue_id
LEFT JOIN dictionary_city
ON venue.city_id=dictionary_city.city_id
LEFT JOIN dictionary_filter
ON venue.venueType_id=dictionary_filter.filter_id
LEFT JOIN dictionary_barType
ON event.barType_id=dictionary_barType.barType_id
LEFT JOIN dictionary_age
ON event.event_age_id=dictionary_age.age_id
LEFT JOIN event_highlight
ON event_highlight.event_id=event.event_id
LEFT JOIN event_description
ON event_description.event_id=event.event_id
WHERE event.event_id="".$event_id."";
When I run the query in PhP Admin it works fine, but when I add the code to my site, I get the following error
"Warning: mysql_fetch_array() expects parameter 1 to be resource,
boolean given in
/home/nye/public_html/theballdrop.com/templates/template.event.php on
line 29 - See more at:
http://theballdrop.com/new-years-eve-madame-tussauds/#sthash.880jgbaa.dpuf"
The query it refers to is "if ($row = mysql_fetch_array($result)){"
I am not sure where to go from here. This is supposed to display information from multiple tables on a single page. $event_id is the variable and a specific event ID would determine the info to display for that specific event page.
please help.
===========================
Here is the entire code for the page:
<?php
// FUNCTION: CONVERT DATE
include (PATH . DIR_INCLUDE . "convert-time.php");
// CONNECT TO NYE DATABASE
include (PATH . DIR_TEMPLATE . "mysql-connect.php");
$sql = "SELECT event.event_id, venue.venue_name, venue.alt_venue_name, venue.venue_address1, venue.cross_street, dictionary_city.city_name, venue.zip, dictionary_filter.filter_name, venue.capacity, event.start_date, event.end_date, dictionary_barType.is_ob, dictionary_barType.barType_name, event.barType_time, event.is_food, event.food_type, event.food_time, dictionary_age.age_name, dictionary_age.age_description, event.ticketCo_id, event.ticket_locator, event.ticket_left, event_description.description, event_highlight.highlight, event.event_tag, event.image_flyer, event.image_flyer_310x425, event.image_2, event.image_2_310x208, event.image_3, event.image_3_310x208 FROM nye_newyears.event LEFT JOIN venue ON venue.venue_id=event.venue_id LEFT JOIN dictionary_city ON venue.city_id=dictionary_city.city_id LEFT JOIN dictionary_filter ON venue.venueType_id=dictionary_filter.filter_id LEFT JOIN dictionary_barType ON event.barType_id=dictionary_barType.barType_id LEFT JOIN dictionary_age ON event.event_age_id=dictionary_age.age_id LEFT JOIN event_highlight ON event_highlight.event_id=event.event_id LEFT JOIN event_description ON event_description.event_id=event.event_id WHERE event.event_id=".$event_id."";
$result = mysql_query($sql, $con);
// START MYSQL QUERY
if ($row = mysql_fetch_array($result)){
// VENUE INFORMATION
$venueName = $row['venue_name']; // OFFICIAL VENUE NAME
$venueName2 = $row['alt_venue_name']; // NAME YOU WANT TO DISPLAY AT TOP OF EVENT PAGE
$venueAddress = $row['venue_address1']; // ADDRESS OF VENUE
$venueCrossStreet = $row['cross_street']; // CROSS STREETS
$venueCity = $row['city_name']; // VENUE CITY
$venueState = $row['state_abb']; // VENUE STATE
$venueZip = $row['zip']; // VENUE ZIP
$venueType = $row['filter_name']; // TYPE OF VENUE
$venueCapacity = $row['capacity']; // CAPACITY OF VENUE
// EVENT INFORMATION
$start = $row['start_date'];
$startDate = convertDate ($start); // START DATE OF EVENT
$startTime = convertTime ($start); // START TIME OF EVENT
$end = $row['end_date'];
$endDate = convertDate ($end); // END DATE OF EVENT
$endTime = convertTime ($end); // END TIME OF EVENT
$ob = $row['is_ob']; // IS THERE OPEN BAR? "YES" OR "NO"
$obType = $row['barType_name']; // TYPE OF OPEN BAR
$obTimes = $row['barType_time']; // OPEN BAR TIMES (START AND END)
$food = $row['is_food']; // IS THERE FOOD? "YES" OR "NO"
$foodType = $row['food_type']; // TYPE OF FOOD SERVED
$foodTimes = $row['food_time']; // TIMES FOOD BEING SERVED (START AND END)
$eventAge = $row['age_name']; // AGE RESTRICTION (IF ANY)
$eventAge_descrip = $row['age_description'];
$ticketCompany = $row['ticketCo_id'];
$ticketID = $row['ticket_locator']; // WIDGET ID
$ticketsLeft = $row['ticket_left']; // TOTAL TICKETS LEFT
$eventDescription = $row['description']; // EVENT DESCRIPTION
$eventHighlight = $row['highlight']; // EVENT HIGHLIGHT
$eventTag = $row['event_tag']; // EVENT LISTING DESCRIPTION
// EVENT IMAGES
$flyer = $row['image_flyer']; // FULL SIZE EVENT FLYER IMAGE
$flyer_310x425 = $row['image_flyer_310x425']; // FLYER IMAGE - 310x425
$image2 = $row['image_2']; // FULL SIZE IMAGE 2
$image2_310x208 = $row['image_2_310x208']; // IMAGE 2 - 310x208
$image3 = $row['image_3']; // FULL SIZE IMAGE 3
$image3_310x208 = $row['image_3_310x208']; // IMAGE 3 - 310x208
}
// VENUE MAP
$venueMap ="$venueAddress+$venueCity+$venueState+$venueZip" ;
// CLOSE DATABASE
mysql_close($con);
// INCLUDE GLOBAL HEADER
include (PATH . DIR_INCLUDE . "site-header.php");
?>
<body>
<?php include_once(PATH . "analyticstracking.php") ?>
<div id="wrapper">
<?php include (PATH . DIR_INCLUDE . "header.php"); ?>
<div class="row">
<div class="middle">
<div class="wrapper event-header">
<div class="left twoThird slogan"> <br />
<h1>
<?=$venueName2?>
</h1>
<h5>
<?=$eventTag?>
</h5>
</div>
<div class="left oneThird last"> <a class="buy-now" href="#tickets" ><span>Buy Now</span></a> Ask a Question </div>
<!-- End: button -->
</div>
</div>
<!--End .middle -->
<div class="wrapper">
<div class="twoThird left columns">
<div class="roundCorner">
<div class="widget data flier-section">
<div class="flier left"> <img src="<?=DIR_IMAGES?><?=$flyer_310x425?>" alt="<?=$venueName2?> New Years Eve 2014" width="310" height="425" /> </div>
<!-- End # left-->
<div class="photos right"> <img src="<?=DIR_IMAGES?><?=$image2_310x208?>" alt="<?=$venueName?> Times Square New Years Eve 2014" /> <img src="<?=DIR_IMAGES?><?=$image3_310x208?>" alt="<?=$venueName?> Times Square New Years Eve" /> </div>
<!-- End # right slider-->
</div>
<!-- End # widget-->
<div class="center detail">
<div class="widget lightgray-base">
<h3 class="widget-heading">Why We Recommend</h3>
<ul class="blist">
<?=$eventHighlight?>
</ul>
</div>
<div class="widget">
<h3 class="headingbar">Overview</h3>
<?=$eventDescription?>
<p><strong>About your Tickets: </strong> (1) Show up early and help reduce the wait time, (2) Make sure to have your physical ticket on hand because you will need to show it to NYPD and security upon request, (3) You accept the risks and agree to adhere to the NYPD rules and regulations for the evening, (4) If you select shipping as your delivery method, tickets will not be sent out until December, (5) A LIVE VIEW of The Ball Drop is not guaranteed. Large crowds should be expected</p>
</div>
</div>
</div>
<!-- End of main-->
<div class="roundCorner"> <a name="tickets" ></a>
<h3 class="widget-heading">Purchase Tickets
<div class="info">Have a Question? Call 212.201.0735 or email info#balldrop.com </div>
</h3>
<div class="widget data">
<p>
<?php
if ($ticketCompany == 1){
// START: CRAVE TICKETS WIDGET -->
echo "<iframe scrolling='auto' frameborder='0' width='99.5%' height='600' src='http://cravetickets.com/widgets/iframe/qU4owWdNmYt/".$ticketID."' ></iframe>";
// END: CRAVE TICKETS WIDGET -->
} else if ($ticketCompany == 2){
// START: LAUGHSTUB TICKET WIDGET -->
echo "<script type='text/javascript' src='http://www.laughstub.com/embed/cart/index.cfm?showTimingID=".$ticketID."&bgcolor=E53D23&fontcolor=ffffff&&brand=ticketmob&displayTitle=no&affiliate=1087&checkout=pmtix'></script>";
// END: LAUGHSTUB TICKET WIDGET -->
}
?>
</p>
<p><strong> Price increase warning:</strong> New Year's Eve ticket prices often go up significantly (100% +) the closer you get to New Years Eve. Also note that many NYE Events will sell out well in advance of New Years Eve. </p>
</div>
</div>
</div>
<!-- End # twoThird-->
<div class="oneThird sidebar last">
<div class="roundCorner lightgray-base">
<h3 class="widget-heading">What to know</h3>
<div class="box data">
<h4>Share This Event</h4>
<p> <span class='st_facebook_large' displayText='Facebook'></span> <span class='st_twitter_large' displayText='Tweet'></span> <span class='st_plusone_large' displayText='Google +1'></span> <span class='st_linkedin_large' displayText='LinkedIn'></span> <span class='st_pinterest_large' displayText='Pinterest'></span> <span class='st_email_large' displayText='Email'></span> </p>
<ul class="know-list">
<li>
<h5>START TIME</h5>
<h4>
<?=$startDate?>
at
<?=$startTime?>
</h4>
</li>
<li>
<h5>END TIME</h5>
<h4>
<?=$endDate?>
at
<?=$endTime?>
</h4>
</li>
<li>
<h5>ADDRESS</h5>
<h4>
<?=$venueAddress?>
<br>
<?=$venueCrossStreet?>
</h4>
</li>
<li>
<h5>VENUE TYPE</h5>
<h4>
<?=$venueType?>
</h4>
</li>
<li>
<h5>AGE REQUIREMENT</h5>
<h4>
<?=$eventAge?>
<br />
<?=$eventAge_descrip?>
</h4>
</li>
<li>
<h5>CAPACITY</h5>
<h4>
<?=$venueCapacity?>
</h4>
</li>
<li>
<h5>OPEN BAR</h5>
<h4>
<?=$ob?>
|
<?=$obType?>
<br />
from
<?=$obTimes?>
</h4>
</li>
<li>
<h5>FOOD SERVED</h5>
<h4>
<?=$food?>
|
<?=$foodType?>
<br />
from
<?=$foodTimes?>
</h4>
</li>
</ul>
</div>
</div>
<!-- End of roundCorner -->
<div class="roundCorner lightgray-base">
<h3 class="widget-heading">Map</h3>
<div class="box"> <img src="http://maps.googleapis.com/maps/api/staticmap?center=<?=$venueMap?>&zoom=16&size=295x245&markers=size:mid%7Ccolor:red%7C<?=$venueMap?>&sensor=false">
<div class="address"> <br />
<h3>
<?=$venueName?>
</h3>
<h5>
<?=$venueAddress?>
<br />
<?=$venueCrossStreet?>
<br />
<?=$venueCity?>
,
<?=$venueState?>
<?=$venueZip?>
</h5>
</div>
</div>
</div>
<!-- End of roundCorner -->
<div class="banner-300"> <img class="fullWidth" src="<?=DIR_IMAGES?>banner-300.jpg"> </div>
<!-- End # Banner-->
</div>
<!-- End of onethird-->
</div>
<!-- End # wrapper-->
<div id="footer-top">
<!-- START: SIMILAR PARTIES -->
<div class="listing-wrapper">
<h2 class="subHeading">We Recommend More NYE Parties <strong>›</strong> </h2>
<ul class="columns">
<?php include (PATH . DIR_INCLUDE . "similar-parties.php"); ?>
</ul>
</div>
<!-- END: SIMILAR PARTIES -->
</div>
<!-- End # footer-top -->
<?php include (PATH . DIR_INCLUDE . "footer.php"); ?>
</div>
<!-- End # row-->
</div>
<!-- End # wrapper-->
</body>
</html>
Add database selection to your connect script, like so:
<?php
$hostname = "localhost";
$username = "{username]";
$password = "[pass]";
$dbname = "nye_newyears";
$con = mysql_connect("$hostname", "$username", "$password");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
if(!mysql_select_db($dbname)) {
die('Could not find or access database ' . $dbname);
}
?>
event is a keyword in mysql. so wrap it inside quotes (`) and try.
echo your $sql in browser copy it and paste it in phpmyadmin and execute, you will get the particular error if any.
At first, check your MySql Table name in server. Sometimes some hosts add a prefix on table name.
You should check $result object first like
if(!$result){
exit(mysql_error());
}else{
if ($row = mysql_fetch_array($result)){
// ....
// ...
}
}
Thank you all for your help. Knittl you were RIGHT!!!
I added the following code to mysql-connect file:
if(!mysql_select_db($dbname)) {
die('Could not find database ' . $dbname);
}
everything works now.
Thank you so much.
i'm using javascript and php for my pop up window. the plan is to pass the row id on the parent page to the pop up window.
it's working fine with this code:
<img src='images/buttons/edit.png' title='Edit Content'>
the pop up appears. but when i try to add ?textID=<?$row['textID']?>, which is the code i'm using to pass the row id that ends up like this:
<img src='images/buttons/edit.png' title='Edit Content'>
the pop up does not work. it appears to be just refreshing the page. thank you for your help.
here's my complete code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
include("global.php");
?>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>About | ILAM</title>
<!-- main css -->
<link href="style.css" rel="stylesheet" type="text/css">
<link href="styleAdmin.css" rel="stylesheet" type="text/css">
<script type= "text/javascript">
<!-- showHideDiv -->
function divHideShow(divToHideOrShow){
var div = document.getElementById(divToHideOrShow);
if (div.style.display == "block"){
div.style.display = "none";}
else{
div.style.display = "block";}
}
<!-- popUp -->
function PopupCenter(pageURL, title,w,h)
{
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>
</head>
<!-- Body -->
<body>
<div id="pagewrap">
<!-- Header -->
<div id="header">
<div class="floating-menu">
<div class="logo"><img src="images/static/ilamLogo.png"></div>
<div class="translator">
</div>
<ul>
<li>Join Us!</li>
<li><div class="indent"> </div></li>
<li>Contact</li>
<li>Career</li>
<li>Gallery</li>
<li>Facilities</li>
<li>Courses</li>
<li>About</li>
<li>Home</li>
<li>Admin</li>
</ul>
</div>
</div>
<!-- //Header -->
<!-- ContentBanner -->
<div id="contentBanner">
<div id="menuContentBanner" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><img src="images/buttons/edit.png" title="Edit Image"></li>
</ul>
</div>
</div>
<img src="images/headers/aboutHeader.jpg"></div> <!--BannerImage -->
<div class="textLeft">
<div id="menuContentBannerText" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><img src="images/buttons/edit.png" title="Edit Content"></li>
</ul>
</div>
</div>
<h3>As an Academic Institution.</h3><p> ILAM takes to heart its responsibilities, not only to its students, but also to its team, and community</p></div> <!-- BannerText -->
<!-- //ContentBanner -->
<!-- Content: Blue -->
<div id="content">
<!-- SidePost -->
<aside id="sidebar">
<section class="widget">
<ul>
<li><img src="images/buttons/factsbtn.png" onmouseover="this.src='images/buttons/factsbtnHover.png'" onmouseout="this.src='images/buttons/factsbtn.png'"></li>
<li><img src="images/buttons/testibtn.png" onmouseover="this.src='images/buttons/testibtnHover.png'" onmouseout="this.src='images/buttons/testibtn.png'"></li>
<li><img src="images/buttons/promosbtn.png" onmouseover="this.src='images/buttons/promosbtnHover.png'" onmouseout="this.src='images/buttons/promosbtn.png'"></li>
</ul>
</section>
</aside>
<!-- //SidePost -->
<!-- OpenerPost -->
<article class="openerPost">
<table>
<tr>
<div id="menuOpenPost" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><img src="images/buttons/edit.png" height="27" width="65"></li>
</ul>
</div>
</div>
</tr>
<tr>
<td><?php
$query="SELECT * from text_tb WHERE textID = '1'";
$result=mysql_query($query);
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);
echo $row[1]; // the email value
?>
</td>
</tr>
</table>
</article>
</div>
<!-- //OpenerPost -->
<!-- Content: White -->
<div id="content">
<article class="mainPost">
<table>
<tr>
<div id="menuMainPost" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><img src="images/buttons/edit.png" title="Edit Content"></li>
</ul>
</div>
</div>
</tr>
<tr><td class="title">Our Mission</td></tr>
<tr>
<td><p>As an academic institution, ILAM takes to heart its responsibilities, not only to its students,
but also to its team, and community. We know that in addition to reaching our vision for the school, ILAM has
a role and certain duties that it has to carry out.</p></td>
</tr>
<tr>
<td class="subtitle">For the Students.</td>
</tr>
<tr>
<td><p>International Language Academy Manila (I.L.A.M.) is a premier language school in Makati
City, Philippines whose mission is to provide quality education to professionals and
non-professionals aiming to be proficient in English. The school takes pride in its ESL/EFL
courses such as: Functional Grammar, Conversation, Business Writing, Business English,
Pronunciation, IELTS review, TOEIC review, etc. which are all taught in a multidisciplinary
setting to ensure comprehensive skill development in the four areas of communication (listening,
speaking, reading, and writing). Apart from teaching English, the school also intends to inculcate strong intercultural
awareness among its students by integrating outdoor activities in its curriculum. </p></td>
</tr>
<tr>
<td class="subtitle">For the Community.</td>
</tr>
<tr>
<td><p>As an academic institution, ILAM takes heart to its responsibilities in promoting education and tourism in the country, which is the reason behind its partnership with the Bureau of Immigration and various multinational companies for English training. It aims to show its foreign students how much the
country has improved, and that the Philippines is a place where they can always find another
home. ILAM goes beyond the technicalities of language. It offers students the opportunity to
foster a deeper understanding of various cultures and thus, enables them to appreciate more the
beauty of language as they get to communicate and interact with different people.</p></td>
</tr>
<tr>
<td class="subtitle">For its Team.</td>
</tr>
<tr>
<td><p>As an academic institution, ILAM takes heart to its responsibilities in promoting education
and tourism in the country, which is the reason behind its partnership with the Bureau of Immigration and various
multinational companies for English training. It aims to show its foreign students how much the
country has improved, and that the Philippines is a place where they can always find another
home. ILAM goes beyond the technicalities of language. It offers students the opportunity to
foster a deeper understanding of various cultures and thus, enables them to appreciate more the
beauty of language as they get to communicate and interact with different people.</p></td>
</tr>
</table>
</article>
</div>
<footer id="footer">
<table>
<tr>
<td>
<div id="menuFooterLeft" class="menuBarStyle">
<img src="images/buttons/edit.png" title="Edit Content">
</div>
<h3>Let's Meet</h3>
<p>2/F Makati Creekside Mall Bldg. Amorsolo Cor. VA Rufino St. Legazpi Village, Makati City Philippines</p></td>
<td>
<div id="menuFooterMiddle" class="menuBarStyle">
<img src="images/buttons/edit.png" title="Edit Content">
</div>
<h3>Let's Talk</h3>
<p>Telephone: 632-8400285 / 519 9502<br>Cellphone: 0917-5324332</p></td>
<td>
<div id="menuFooterRight" class="menuBarStyle">
<img src="images/buttons/edit.png" title="Edit Content">
</div>
<h3>The Affiliates</h3>
<p>Accenture<br>
Asian Institute of Management<br>
ConveyThis<br>
The Little Web Directory<br></td>
</tr>
<tr>
<td class="copyright">Copyright © 2012 ILAM</td>
</tr>
</table>
</footer>
</div>
<!-- /#pagewrap -->
</body>
</html>
you need to use echo like:
<?php echo($row['textID']) ?>
Looks like it is PHP. To insert the PHP variable into your HTML, use echo, like this:
<a href="#"
onclick="PopupCenter('example.php?textID=<?php echo $row['textID'] ?>', 'myPop1',500,400); " class="add">
<img src='images/buttons/edit.png' title='Edit Content'>
</a>
if shorthand is allowed, this should work
<?=$row['textID']?>
I need to display the ON AIR CONTENT every Friday at 9pm and then stop at 12am and revert back to the OFF AIR CONTENT.
Below are the 2 sets of code that I manually change to make this possible. If I get the right code I can automate this.
Can anyone help me?
/* ON AIR CONTENT*/
function banner_rotator() {
if (is_home()) { ?>
<div id="rotator"><iframe width="630" height="386" src="http://www.ustream.tv/embed/8805257?v=3&wmode=direct?autoplay=true" scrolling="no" frameborder="0" style="border: 0px none transparent;"> </iframe> <?php if(function_exists('vslider')){ vslider('frontpage'); } ?></div>
<div class="main">
<!-- FIFTH EXAMPLE -->
<div class="view view-fifth">
<img src="../1.jpg" />
<div class="mask">
<h2>FULLY LOADED 2012</h2>
<p>This event has been cancelled.</p>
Details
</div>
</div>
<div class="view view-fifth">
<img src="../2.jpg" />
<div class="mask">
<h2>KAFINAL - FALLING IN LOVE</h2>
<p>"The feedback to Falling in Love has been tremendous all over. I am getting calls from people in Jamaica, the Caribbean and even in the States...</p>
Read More
</div>
</div>
</div>
<?php }
}
add_action('thesis_hook_before_content', 'banner_rotator');
_____________________________________________________________________________________
/* OFF AIR CONTENT */
function banner_rotator() {
if (is_home()) { ?>
<div id="rotator"> <?php if(function_exists('vslider')){ vslider('frontpage'); } ?></div>
<div class="main">
<!-- FIFTH EXAMPLE -->
<div class="view view-fifth">
<img src="../1.jpg" alt="FULLY LOADED 2012" title="FULLY LOADED 2012" />
<div class="mask">
<h2>FULLY LOADED 2012</h2>
<p>This event has been cancelled.</p>
Details
</div>
</div>
<div class="view view-fifth">
<img src="../2.jpg" alt="KAFINAL - FALLING IN LOVE" title="FULLY LOADED 2012" />
<div class="mask">
<h2>KAFINAL - FALLING IN LOVE</h2>
<p>"The feedback to Falling in Love has been tremendous all over. I am getting calls from people in Jamaica, the Caribbean and even in the States...</p>
Read More
</div>
</div>
</div>
<?php }
}
add_action('thesis_hook_before_content', 'banner_rotator');
The PHP date("G") function will give you the time in 24 hour format as a string. You may then test that and make whatever decisions you would like.