london77 Posted December 16, 2010 Share Posted December 16, 2010 Hi, I have some files stored in mysql db. I have created a web page which shows the list of tutorials from db. at first i was creating a separate php page for each tutorial, but later i have decided that it would be easier and simpler if i can create one php page and whenever i click the tutorials it will change the content of this page. example: when i click "tut002" from list. it will change the content of tutorials.php . I have these tutorials in .html format here is the code i have in turorials.php once again, whenever i click a tutorial this include part needs to change automatically to whatever i click echo '<div class="content">'; include ("inc/tut001.html"); echo '</div>'; it will be really appreciated if you have a sample code for this. sorry for my english. thank to whoever interested in this matter. Quote Link to comment https://forums.phpfreaks.com/topic/221872-content-change-dynamically-on-click/ Share on other sites More sharing options...
litebearer Posted December 16, 2010 Share Posted December 16, 2010 perhaps a little ajax - http://kokeshnet.com/wordpress/?p=186 Quote Link to comment https://forums.phpfreaks.com/topic/221872-content-change-dynamically-on-click/#findComment-1148166 Share on other sites More sharing options...
Rifts Posted December 16, 2010 Share Posted December 16, 2010 have the link to the tutorials send the tutorial id in the url then use $_GET to grab the id then you can echo out all the info you need and it will change depending on which link was clicked Quote Link to comment https://forums.phpfreaks.com/topic/221872-content-change-dynamically-on-click/#findComment-1148187 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.