I am creating a project on PHP. But I have a problem. I want to pass some values from a section to another section. For example: In first section I am showing all products, and second section I am showing product details. When I click a product on first section, products values should pass second section. I am sharing my codes. Thanks
First Section
<section class="section pb-60 sm-pt-90">
<!-- Portfolio Items -->
<div id="portfolio-gallery" class="portfolio-container isotope-container portfolio-gallery row animated mfp-gallery" data-animation="fadeInUp" data-animation-delay="1200">
<article class="portfolio-item isotope-item col-md-4 col-sm-6 tasarim">
<div class="project-container">
<a href="http://blogaktuel.com//upload/Ekran Alıntısı.PNG" data-size="1080x1440" class="portfolio-gallery__img--main">
<img src="http://blogaktuel.com//upload/Ekran Alıntısı.PNG" alt="" style="width:360px; height:256px;">
<div class="overlay">
<div class="overlay-wrapper">
<div class="overlay-inner background-dark-5 opacity-70"></div>
</div>
</div>
</a>
<div class="project-details">
<h4 class="project-title heading-uppercase">Yeni Proje Mesela</h4>
</div>
</div>
</article>
Second Section
<div id="detay" class="ed-slide">
<div class="slide-container">
<div class="slide-content">
<section class="section sm-pt-0">
<div class="container">
<h2 class="text-white text-center animated" data-animation="fadeInDown"><!-- Project Title --></h2>
<div class="divider divider-alt divider-center divider-light animated" data-animation="fadeInDown" data-animation-delay="300"><span></span></div>
<p class="lead text-white mb-50 text-center animated" data-animation="fadeInDown" data-animation-delay="600"><!-- Project Info --></p>
<!-- Project Images etc. -->
</div>
</section>
</div>
</div>
</div>
You can make that using 2 ways:
-First way: when clicking on a product, you reload the page, and you pass the id in the url, and you display the data in the other section.
-Second way(Best way): via jquery for example, when clicking on a product, you load the data for this product and you display it in the other section.
I solved my problem with jQuery. I am sharing jQuery codes.
$(".details").click(function(){
var proje_baslik = $("input[name=proje_baslik]").val();
var proje_aciklama = $("input[name=proje_aciklama]").val();
var proje_url = $("input[name=proje_url]").val();
var proje_fiyat = $("input[name=proje_fiyat]").val();
var proje_resim = $("input[name=proje_resim]").val();
$("#detay .proje_baslik").html(proje_baslik);
$("#detay .proje_aciklama").html(proje_aciklama);
window.location.href = "http://localhost:81/Projeler/kodaktuelOnePage/#detay";});
Thanks for all comments
Related
I created a blog category from the menu. In Joomla 4 -> In Blog Layout -> Columns ، I can give a value to the column, but if we increase the value by one, the displayed contents are not balanced. And the "" did not close properly. After a general search, I realized that the contents are arranged as follows :
HTML :
<div class="blog-items">
<div class="blog-item">
<div class="content">1</div>
<div class="blog-item">
<div class="content">2</div>
</div>
<div class="blog-item">
<div class="content">3</div>
<div class="blog-item">
<div class="content">4</div>
<div class="blog-item">
<div class="content">5</div>
</div>
<div class="blog-item">
<div class="content">6</div>
</div>
<div class="blog-item">
<div class="content">7</div>
</div>
</div>
</div>
</div>
</div>
HTML The right way to be :
<div class="blog-items">
<div class="blog-item"><div class="content">1</div></div>
<div class="blog-item"><div class="content">2</div></div>
<div class="blog-item"><div class="content">3</div></div>
<div class="blog-item"><div class="content">4</div></div>
<div class="blog-item"><div class="content">5</div></div>
<div class="blog-item"><div class="content">6</div></div>
<div class="blog-item"><div class="content">7</div></div>
</div>
Note: When I disable "loadTemplate", the loop is displayed correctly and the divisions are closed correctly.
I also checked the information inside the "$this->loadTemplate('item')" but found no problem.
PHP :
<div class="blog-items">
<?php foreach ($this->intro_items as $key => &$item) : ?>
<div class="blog-item">
<?php
$this->item = & $item;
echo $this->loadTemplate('item'); //Included <div class="content">value</div>
?>
</div>
<?php endforeach; ?>
</div>
it's true,fixed.
All content had a tag before page break,
You cannot insert it inside a div. The closing tag will be missing. Close the tag before inserting Read More.
Little did I know that using before page break can be so destructive, and I've been looking for problems with PHP code for about a week now.
I am designing a front-end login/signup page by using html and materialize css. The features that I am trying to include are:
a tab view inside a card with an unordered list with two items:
"Login" (<a href="#login">), and
"SignUp" (<a href="#signup">).
Two separate content areas with their own id: "login" and "signup"
My goal is to have the "id=login" content load when a user clicks Login, and likewise "id=signup" content to load on clicking SignUp but that's not working. As the image shows, both the tab view and both content "cards" are displayed.
Screenshot
This is my code
<div class="row">
<div class="col l6 offset-l3 m8 offset-m2 s12">
<div class="card-panel center">
<ul class="tabs">
<li class="tab">Login</li>
<li class="tab">Sign Up</li>
</ul>
</div>
</div>
<!-- Login content area -->
<div class="col l6 offset-l3 m8 offset-m2 s12" id="login">
<div class="card-panel center">
</div>
</div>
<!-- Sign Up content area -->
<div class="col l6 offset-l3 m8 offset-m2 s12" id="signup">
<div class="card-panel center">
</div>
</div>
<!-- row ends here -->
</div>
I have created a single page Webapp using Bootstrap 3. It looks and feels like the standard IOS contacts app. I am using it for personal data on contacts. The contacts are in a sql table which I am querying. I am trying to pass a the PHP mySql id result to an internal #details id element.
The link is:
name
The div is:
<article id="details">
<div class="container-fluid">
<?php
$therecord = $_GET['page'];
$result = $Con ->query("SELECT * FROM `myTable` WHERE `id` = '$therecord'");
$details_row = $result->fetch_array(MYSQLI_BOTH);
?>
<div class="row">
<a href="#on_duty"><div class="col-xs-1"><span class="glyphicon glyphicon-menu-left floatleft apple_back_chevron appleBlue" aria-hidden="true"></span></div>
<div class="col-xs-6"><p class="apple_back_text appleBlue">On Duty Coordinators</p></div></a>
<a href="#edit_coordinators?page=<?php echo $details_row['id'] ;?>"><div class="col-xs-4"><p class="apple_forward_text appleBlue floatright">Edit</p></div>
<div class="col-xs-1"><p class="glyphicon glyphicon-menu-right floatright apple_forward_chevron appleBlue" aria-hidden="true"></p></div></a>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-3">
<img class="img-circle" src="" alt="photo">
</div>
<div class="col-xs-9">
<h2><?php echo $details_row['name'];?></h2>
</div>
</div>
<div class="row">
<div class="apple_list appleGray">
<div class="col-xs-8">
<p class="appleBlue">station</p>
<p class="appleDGray"><?php echo $details_row['station']; ?></p>
</div>
<div class="col-xs-4">
</div>
</div>
</div>
<div class="row">
<div class="apple_list appleGray">
<div class="col-xs-8">
<p class="appleBlue">mobile</p>
<p class="appleDGray"><?php echo $details_row['mobile']; ?></p>
</div>
<div class="col-xs-2"> <img class="img-responsive apple_Glyph" src="_images/sms.png"></div>
<div class="col-xs-2"> <img class="img-responsive apple_Glyph" src="_images/phone.png"></div>
</div>
</div>
</div> <!-- /container -->
</article>
How do I pass a PHP "?page=$recordNo" internally? The page id is being passed, but not getting picked up by the next PHP
Try:
name
It is also very possible you could write it like so:
name
Basically, ? starts the query string and (if included) is always before the page anchor (fragment) # in a URI. See Uniform Resource Identifier for more info.
You can't do this:
name
Because there's an "hashtag", so it's interpreted by the browser as an in-page navigation, and the request isn't sent to the server, unless you catch it with javascript and then perform some ajax request...
This problem seems completely unrelated to PHP or MySQL.
Just look at the generated mark-up, which will look like this (re-indented to improve readability):
<a href="#edit_coordinators?page=333">
<div class="col-xs-4">
<p class="apple_forward_text appleBlue floatright">Edit</p>
</div>
<div class="col-xs-1">
<p class="glyphicon glyphicon-menu-right floatright apple_forward_chevron appleBlue" aria-hidden="true"></p>
</div>
</a>
There're two obvious issues:
The <a> tag is an inline element. It cannot have a whole bunch of block elements inside.
You inject the page GET parameter in the hash part of the URL, which is client-side only and is never sent to the server. It should be ?page=333#edit_coordinators
Said that, I admit I can't fully understand what you have in mind but it you really have a single-page application it has to be coded in JavaScript and possibly use AJAX. With just server-side technologies you can only
build a conventional web application.
I have a piece of jquery code which load a file as
$(".data_container").load(base_path+"sign_up/signup.php?trigger_id=random");
Signup.php contains
<?php include_once("../libs/php_header/php_header.php"); ?>
<div class="ui modal s_umodal">
<i class="close icon"></i>
<div class="header">
Modal Title
</div>
<div class="image content">
<div class="image">
An image can appear on left or an icon
</div>
<div class="description">
A description can appear on the right
</div>
</div>
<div class="actions">
<div class="ui button">Cancel</div>
<div class="ui button">OK</div>
</div>
</div>
<script>
$('.s_umodal')
.modal('show');
</script>
The problem is, I can call the modal box and it shows up. but next time I click on the trigger button (button to show modal) it display another one even though I have closed the previous one. so now I am left with two modal boxes. and if I click multiple times i will be left with multiple modal boxes. I am using Semantic-UI.
The problem with your implementation is that every time you call $('.data_container').load(base_path+"sign_up/signup.php?trigger_id=random"); you are creating a new dom element with the div you are fetching from that ajax call. $('.s_umodal').modal('show'); is then showing all of the modal boxes returned from the server.
Without restructuring your code significantly, One approach is to not keep fetching the content of the div over and over again. The <div> will be a part of the main html that contains data_container. Your Ajax call can return the script that shows the dialog box.
HTML:
<div class="data_container"></div>
<div class="ui modal s_umodal">
<i class="close icon"></i>
<div class="header">
Modal Title
</div>
<div class="image content">
<div class="image">
An image can appear on left or an icon
</div>
<div class="description">
A description can appear on the right
</div>
</div>
<div class="actions">
<div class="ui button">Cancel</div>
<div class="ui button">OK</div>
</div>
</div>
Your Ajax call could be returning:
<script>
$('.s_umodal').modal('show');
</script>
Your call to load the content could remain the same.
$(".data_container").load(base_path+"sign_up/signup.php?trigger_id=random");
If you are up for a significant change however, You can try to use JSON web services instead of returning <script>.
Unfortunately I won't be able to describe my issue without a visit to my site. DadGab.com.
I have a 'featured slider' col-md-8 with a sidebar to the right. It appears there is some padding or spacing set somewhere and I am unable to find it. I've checked all theme files, style.php. All I am trying to do is move the sidebar on the right side to the top of the page. The empty space did used to be a col-md-4 container which the coding has since been removed.
If I remove the featured slider code from the main page, the 'latest' posts as well as the menu do move to the top of the screen without the padding issue.
Any help would be greatly appreciated.
you have the following structure
<div class="col-md-8"></div>
<div class="clear"></div>
<div class="col-md-8"></div>
<div class="col-md-4"></div>
if i understand you corectly you should have
<div class="col-md-8"></div>
<div class="col-md-4"></div>
so join the code from both .col-md-8 containers, remove the div with class "clear" and it should be OK. This is all done in template homepage.php
You have some problems in your layout logic. You need to think about the way columns and rows work.
You should have a left column (col-md-8) and a sidebar column (col-md-4) and they should be adjacent. The left column should contain ALL of the left content.
Here's what you have:
<div class="row">
<div class="col-md-8">
<!-- featured -->
</div>
<div class="clear"><!-- SEPARATION --></div>
<div class="col-md-8">
<!-- REAST OF LEFT COLUMN -->
</div>
<div class="col-md-4">
<!--
SIDEBAR
You want this next to the left column.
But it's not adjacent!
-->
</div>
</div>
Here's what you want
<div class="row">
<div class="col-md-8">
<!-- FEATURED -->
<!-- REST OF LEFT COLUMN -->
</div>
<div class="col-md-4">
<!-- RIGHT SIDEBAR -->
</div>
</div>
Your current scenario is following
<div class="col-md-8">
featured slider
</div>
<div class="col-md-8">
content
</div>
<div class="col-md-4">
sidebar
</div>
Change it to following
<div class="col-md-8">
featured slider
content
</div>
<div class="col-md-4">
sidebar
</div>
Please let me know if issue is still there :)
After your div "col-md-8" is coming a clearfix. Just creat a "col-md-4" after "col-md-8".
I already tested here, just do it.
Inside the tags
<div class="container"><div class="row">
rearrange the order, from:
<div class="col-md-8"> ... </div>
<div class="clear"></div>
<div class="col-md-8"> ... </div>
<div class="col-md-4"> ... </div>
to:
<div class="col-md-8"> ... </div>
<div class="col-md-4"> ... </div>
<div class="clear"></div>
<div class="col-md-8"> ... </div>
In addition, consider if you really want to keep the div that clears out your floats:
<div class="clear"></div>
If not, comment it out, like so:
<!-- <div class="clear"></div> -->
This indeed moves up your sidebar to the position you want. However, I suspect you will want the last div (of class col-md-8) to be positioned higher. If so, it sounds as if you will need to create two columns inside the row (the div of class row).