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.
Related
I am generating new cards with PHP code, but they do not listen to the grid of bootstrap 4.
Raw html code works fine and displays them like they should be.
<div class="container-fluid padding">
<div class="row padding">
<?php foreach ($contacts as $contact): ?>
<div class="col-sm-12 col-md-4">
<div class="card">
<?php echo '<img class="card-img-top" src="data:image/png;base64,'.base64_encode( $contact['horse_image'] ).'"/>'; ?>
<div class="card-body">
<h4 class="card-title"><?=$contact['horse_name']?></h4>
<p class="card-text"><?=$contact['short']?></p>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<hr class="my-4">
</div>
This is the code for generated cards from database, it works just fine but bootstrap is not applied on that so it looks very bad like that but it should be looking like that
Is there a way to apply bootstrap after the cards are generated?
Sorry, can't comment yet because of the reputation of 50 :D
In your foreach block is one closing div tag too much ;)
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
**this is my home page ** i am showing data coming from mysql to card but is have same tag color i.e class="tag tag-pill tag-danger"
i am using ng-class={{hos.class}} /*class is a coloumn in table */
<div class="col-md-5" ng-repeat="hos in ho">
<div class="col-md-6">
<div class="card"> <img class="img-fluid" ng-src="{{hos.img}}" alt="">
<div class="card-img-overlay"> <span ng-class=" ">{{hos.tag}}</span> </div>
<div class="card-block">
<div class="news-title">
<h2 class=" title-small">{{hos.topic}}</h2>
</div>
<p class="card-text"><small class="text-time"><em>{{hos.time}}</em></small></p>
</div>
</div>
</div>
</div>
try ng-class="hos.tag" or class="{{hos.tag}}"
You are using ng-class incorrectly: its expression comprises of an object where each property is a class and the value is an expression to evaluate to conditionally apply that class when truth.
For example ng-class="{'active': button.active}"
Hopefully, this fiddle will help: jsFiddle
I have created a web page to display image, topic and details. Just now i have a static html page this is just a page i have nothing implemented any thing.
<section class="section-02">
<div class="container">
<h3>
<div class="heading-large">Current Best</div>
</h3>
<div class="row">
<div class="col-md-4">
<div class="card"> <img class="img-fluid" src="img/media-1.jpg" alt="">
<div class="card-block">
<div class="news-title"><a href="#">
<h2 class=" title-small">An Alternative Form of Mental Health Care Gains a Foothold</h2>
</a></div>
<p class="card-text"><small class="text-time"><em>3 mins ago</em></small></p>
</div>
</div>
<ul class="news-listing">
<li>Key Republicans sign letter warning against candidate</li>
<li>Obamacare Appears to Be Making People Healthier</li>
<li>Syria war: Why the battle for Aleppo matters</li>
<li>‘S.N.L.’ to Lose Two Longtime Cast Members</li>
</ul>
</div>
<div class="col-md-4">
<div class="card"> <img class="img-fluid" src="img/media-2.jpg" alt="">
<div class="card-block">
<div class="news-title"><a href="#">
<h2 class=" title-small">Delta passengers got pizza delivered to the plane</h2>
</a></div>
<p class="card-text"><small class="text-time"><em>3 mins ago</em></small></p>
</div>
</div>
<ul class="news-listing">
<li>Syria war: Why the battle for Aleppo matters</li>
<li>Key Republicans sign letter warning against candidate</li>
<li>Obamacare Appears to Be Making People Healthier</li>
<li>‘S.N.L.’ to Lose Two Longtime Cast Members</li>
</ul>
</div>
<div class="col-md-4">
<div class="card"> <img class="img-fluid" src="img/media-3.jpg" alt="">
<div class="card-block">
<div class="news-title"><a href="#">
<h2 class=" title-small">Minorities Suffer From Unequal Pain Treatment</h2>
</a></div>
<p class="card-text"><small class="text-time"><em>3 mins ago</em></small></p>
</div>
</div>
<ul class="news-listing">
<li>‘S.N.L.’ to Lose Two Longtime Cast Members</li>
<li>Key Republicans sign letter warning against candidate</li>
<li>Obamacare Appears to Be Making People Healthier</li>
<li>Syria war: Why the battle for Aleppo matters</li>
</ul>
</div>
</div>
</div>
</section>
now i want to store this in mysql database using angular and php
Although it's technically possible to store an image in a BLOB type, I totally discourage you to do it and rather use a could-based filesystem such as S3 or the local filesystem of the server. Just store on the DB the URI of the image.
Storing BLOBS in the DB will make it slower, the backups will take much longer and the queries must be optimized to avoid retrieving the BLOB. A simple SELECT * FROM users; can kill your DB if you have thousands of users.
I want to display news from anoter web page onto mine, and I cannot figure out the best method for this.
The news on the other web page are displayed within a div class like the following
<div class="news-container">
<div class="news-list"><img src="abcd.jpg" /><strong>abcd</strong>
<p>What you see is what you get. <span class="morelink">Read more</span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><img src="efgh.jpg" /><strong>efgh</strong>
<p>What you see is what you get. <span class="morelink">Read more</span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><img src="ijkl.jpg" /><strong>ijkl</strong>
<p>What you see is what you get. <span class="morelink">Read more</span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><img src="mnop.jpg" /><strong>mnop</strong>
<p>What you see is what you get. <span class="morelink">Read more</span></p>
<div class="clear-both"></div>
</div>
I would like to be able to circle through the news and display them on my own page and rearranged according to our own site layout.
<div class="other-news">
<div class="news-list"><strong>abcd</strong>
<p>What you see is what you get. <img src="abcd.jpg" /></p>
</div>
<div class="news-list"><strong>efgh</strong>
<p>What you see is what you get. <img src="efgh.jpg" /> </p>
</div>
<div class="news-list"><strong>ijkl</strong>
<p>What you see is what you get. <img src="ijkl.jpg" /> </p>
</div>
<div class="news-list"><strong>mnop</strong>
<p>What you see is what you get. <img src="mnop.jpg" /> </p>
</div>
All suggestions are more than welcome.
// Nyborg
You need to look at PHP cURL or file_get_contents(security issues) or look at PHP HTML DOM Parser.
Also look at the legality of what your doing? (they normally provide an API if they want to let you have content)