I am trying to get the following to happen:
if "field_ListingID" = h100 then show div x
or if "field_ListingID" = h200 then show same div x
Basically, within the same table1, I have 2 values "h100 "& "h200". I am able to pull just one value fine, but how do I pull if red or if blue.
Here is the code I have currently that is working for just one value. I tried placing the same php code for "h100" under the else statement, but that generated errors:
<?php if ($row["field_ListingID"]=="h100"){ ?>
<div class="featured-property">
<a href="#">
<div class="inner-logo"><img src="images/inner-logo.png" alt="LOGO" width="136" height="41" /></div>
<div class="bg-txt">
<div class="star-icon"></div>
<div class="txt"><p>Featured <span>Property</span></p></div>
</div>
</a>
</div>
<?php } else { ?>
<div style="margin-top: 20px; min-height:55px;"> </div>
<?php }?>
Thanks.
Here try this, I added the or operator (||) to your if statement:
<?php if ($row["field_ListingID"]=="h100" || $row["field_ListingID"]=="h200" ){ ?>
<div class="featured-property">
<a href="#">
<div class="inner-logo"><img src="images/inner-logo.png" alt="LOGO" width="136" height="41" /></div>
<div class="bg-txt">
<div class="star-icon"></div>
<div class="txt"><p>Featured <span>Property</span></p></div>
</div>
</a>
</div>
<?php } else { ?>
<div style="margin-top: 20px; min-height:55px;"> </div>
<?php }?>
Related
i have a website in which i used carousel sliders to display images and its values, I have 3 carousel in my homepage, 3 of them have same code, however the first carousel is not displaying name and price like the 2nd and 3rd carousel:
as you can see in the image
the code for this carousel is below:
<section class="carousel_sec">
<div class="container">
<div class="row ">
<h3 class="carousel_heading">Trending Birthday Cakes <button class="pull-right"><span>VIEW ALL</span><!-- <span class="visible-xs">>></span> --></button></h3>
<hr>
<div class="carou">
<div class="demo">
<ul id="landing_products1">
<?php foreach($trending_products1 as $key=>$val) { ?>
<li>
<div class="item">
<div class="pad15 content_div">
<div class="carou_thumb">
<img class="st_img" src="<?php echo ADMIN_IMG.'cakes/'.$val['image'][0]['cake_image'];?>" alt="<?php echo $val['cake_name']; ?>" />
<img class="nd_img" src="<?php echo ADMIN_IMG.'cakes/'.$val['image'][0]['cake_image'];?>" alt="<?php echo $val['cake_name']; ?>" />
<p>
<?php echo $val['cake_name']; ?>
</p>
<?php
$btp_price=0;$offer_price=0;
$btp_price=$val['price'][0]['btp_price'];
$offer_price=$val['price'][0]['offer_price'];
?>
<div class="price text-center" style="width:100%;float:left;">
<span class="amount" style="color:#f2136e;font-size:14px;">
<?php echo PRICE_UNIT;?><?php echo $offer_price;?>
</span> (
<s> <?php echo $btp_price;?></s>)
<span> </span>
<br>
</div>
<!--<br><span><?php echo PRICE_UNIT;100; ?></span></p>-->
</div>
</div>
</div>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
</section>
<?php } ?>
while inspecting in browser the value is showing, the live URL is enter link description here
can anyone please tell me what could be wrong here, thanks in advance
You'll need to tweak the css to reveal the content that is hidden.
To push you in the direction, see the improvement with:
#landing_products1 {
height: 330px;
margin-top: -65px;
}
I don't know how responsive you need to be with your UI, so let's call this a temporary fix. The first carousel's dimensions don't perfectly match the others, so I'll leave the fine tuning to you.
It also appears that you have some js and css issues to mop up.
<html>
<div class="product-tile ">
<div class="product-image">
<img src="1.jpg">
<img src="2.jpg">
</div>
<div class="brand">
<a href="example1.html" class="brand-link">
Example1
</a>
</div>
<div class="product-name">
Craquelé-Effect Leather Square-Toe Mules
</div>
</div>
<div class="product-tile ">
<div class="product-image">
<img src="11.jpg">
<img src="12.jpg">
</div>
<div class="brand">
<a href="example2.html" class="brand-link">
Example2
</a>
</div>
<div class="product-name">
Craquelé-Effect
</div>
</div>
</html>
My content is like this in HTML and want to copy it on my website.
My code is like how to get the title, images, brand and there price. I've used file_get_html in it but I'm getting issue in fetching the datalike brand and price.
require('simple_html_dom.php');
$html = file_get_html('new_arrival.html');
//$product = [];
foreach ($html->find('div.wrap-desc') as $pro) {
$proDetails = $pro->find('div.brand');
}
If you are using jQuery you can get the contents of a DOM element using .html():
$('html').html()
Alternatively in vanillaJS:
let x = document.getElementByTagName('html')
console.log(x.innerHTML)
https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML
Here's my HTML and PHP code but videos shown in vertical line, i use inline-block in CSS code but it doesn't work.
Please help me i am new to this.
HTML Code:
<div class="wrap">
<div class="grid">
<div class="preview">
<a title="<?php echo $video_title; ?>
"href="watch.php?videoid=<?php echo $video_id;?>">
<img src="videos/thumbnails/<?php echo $thumbnail;?> " />
</a>
<div class="time">00.00</div>
</div>
<div class="data">
<h3><a href="watch.php?videoid=<?php echo $video_id;?>">
<?php echo substr( $video_title,0,19);?>
<?php echo substr( $video_title,19,20);?>
</a>
</h3>
<div class="video-watch">
Watch Now
</div>
<div class="clear"> </div>
<div class="lables">
<p>Uploaded by:<a <?php if (isset($_SESSION['usr_name']))?>>
<?php echo $_SESSION['usr_name'] ;?>
</a>
</p>
</div>
<?php } }?>
</div>
</div>
Use an IFrame.
Here's an example of what it looks like:
<iframe width="420" height="315" src="https://www.youtube.com/embed/XGSy3_Czz8k">
Good day everyone.
Just started working in Firm that has given me task to optimize their website (nigeria-friends(dot)com/staging.academix) responsively, which I have been doing gradually and am not all that proficient with PHP, HTML and CSS. But, I can confidently read and understand some couple of stuff in them. Thus;
I have been trying to center all the contents on the frontpage image banner
Reveal or make a particular button "How Academix can benefit you" appear on mobile devices of max-width:380px with no success and that has got me perplexed.
I have searched all through the CSS and couldn't get my head around any to fix it. Hence, me calling for help. And having looked into the index.html from the based folder I found something, the aforementioned buttons were in a loop sort of, which I don't understand.
Here is the index code:
<div class="col-sm-12 col-xs-10 col-centered">
<?php if(!isset($_SESSION["acc_identifier"])){ ?>
<!--
<div class="col-sm-4 col-centered">
<a href="<?php echo $URLMAIN; ?>/access/signup.html">
<div id="fb-login" class="social-login">
<div class="social-text">Sign up for free</div>
</div>
</a>
</div>
-->
<div class="col-sm-6 col-centered">
<a href="<?php echo $URLMAIN; ?>/about/benefits.html">
<div id="yahoo-login" class="social-login">
<div class="social-text">How <?php echo $web_shortName; ?> can benefit you</div>
</div>
</a>
</div>
<div class="col-sm-6 col-centered">
<a href="<?php echo $URLMAIN; ?>/access/host.html">
<div id="g-login" class="social-login">
<div class="social-text">Host your journal on <?php echo $web_shortName; ?></div>
</div>
</a>
</div>
<?php }else{ ?>
<div class="col-sm-6 col-centered">
<a href="<?php echo $URLMAIN; ?>/about/benefits.html">
<div id="yahoo-login" class="social-login">
<div class="social-text">How <?php echo $web_shortName; ?> can benefit you</div>
</div>
</a>
</div>
<div class="col-sm-6 col-centered">
<a href="<?php echo $URLMAIN; ?>/access/host.html">
<div id="g-login" class="social-login">
<div class="social-text">Host your journal on <?php echo $web_shortName; ?></div>
</div>
</a>
</div>
<?php } ?>
</div>
I can't paste in all the index.html code here as is quite long and length, which is generating error format when I try to, which is mixed php and html, where PHP starts the index.html. So also is the CSS file.
#media (min-width: 380px){
#yahoo-login .social-text {
display: none;
}
}
OR
#media (max-width: 380px){
#yahoo-login .social-text {
display: block;
}
}
I have 10 images of each brand and want to display brand by brand with there press releases images.
Example:
Product 1:
press release_image1,press release_image2,press release_image3 so on..
Product 2:
press release_image1,press release_image2,press release_image3 so on..
Product 3:
press release_image1,press release_image2,press release_image3 so on..
<?php foreach($press as $p){ ?>
<div class="header">
<h1 class=''>
<a href="<?php echo base_url('index.php/brand/view')."/".$p->brand_id;?>">
<?php
echo $p->brand_name;
?>
</a>
</h1>
</div>
<section id="portfolio-preview-items" class="row four-cols rows_1">
<?php //$row = $this->dashboard->get_press_release($id);
?>
<!-- Portfolio Normal Mode -->
<div class="portfolio-item design web-design v3" data-id="354" style="height: 475px; margin-bottom: 20px;">
<div class="he-wrap tpl2">
<a href="<?php echo base_url('assets/files/press_release') . '/' . $p->press_image; ?>" class="image-614" data-lightbox="event_img" data-title="<?php echo $p->press_title; ?>" >
<img style="cursor:pointer;" src="<?php echo base_url('assets/files/press_release') . '/' . $p->press_image; ?>" alt="">
</a>
<div class="shape4"></div>
<div class="he-view">
<div class="bg a0" data-animate="fadeIn">
<div class="center-bar v1">
<a href="<?php echo base_url('index.php/brand/view').'/'.$p->brand_id; ?>" class="link a0" data-animate="zoomIn">
<i class="moon-link-4"></i>
</a>
</div>
</div>
</div>
</div>
</div>
<!-- Portfolio Normal Mode End -->
</section>
<?php } ?>
You can combine id and particular images(concat by ',') from mysql query.
then in php code u can use explode and implode to display each images