html - How do I add dynamic urls to each loaded post in PHP and MYSQL -
ok have mysql database contains pictures , text. able load multiple pictures on page, gallery. want make each picture have url when shared on social networks plugin can detect each picture individually. example code:
<div id="mainframe" class="gallerypic"> <div class="pic"> <img src="'.$example.'"/> </div> <div class="social network plugins">social button</div> </div> how make each gallery loaded each having different url? url:
www.example.com/something/id?=whatever/
if understand, consider use rewritemod / rewriterules in apache .htaccess handle urls , convert url like:
www.example.com/something/whatever/id/ to
www.exemple.com/something.php?whatever=id so, in php script can whatever param , submit mysql database.
a simple rewriterule:
rewriterule ^news/(.*?)$ content.php?content=read-news&news=$1 [nc] where $1 represents (.*?), or everythig after /
rewrite documentation: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
Comments
Post a Comment