php - Change the content of webpage when clicking different links -
i'm not sure how describe question or how begin. can start i'm making website in php school , i've never used php before. , need alter one part of page i.e the sidebar. or content, depending if user clicks i.e school, contact etc.
on index.php sidebar shows news. in navbar if click i.e useful links sidebar should alter showing news showing couple of links.
and if possible, if click on 1 of links should alter content under navbar , sidebar should still show useful links.
<?php include('include/header.php'); include('include/nav.php'); ?> <div class=content> <h1>heading 1</h1> <p>text goes here</p> </div> <?php include('include/nyheter.php') ?> <--not part of code! sidebar <?php include('include/footer.php')
for now, i've got news shown in index.php using <iframe>
code. want rid of <iframe>
, utilize <div class=sidebar">
or utilize id instead of class.
i've search around find useful information, of them says ajax , jquery, don't know or how utilize =(
if need more information, inquire spesific possible, can give right info =)
edit i've uploaded entire website google drive share you. may see, i've created bunch of new .php files (most of them other versions created in html, , converted php. link is: https://docs.google.com/folder/d/0bxsqmlxovlrhdmflofyzmjlzrhc/edit?usp=sharing
by way, website in norwegian. hope info can help tell me how solve question. remember, totally new php , other programming languages other html & css.
you utilize if sentence alter page content according url
for example
if($_get['page'] == "about") { echo "about page content"; } elseif($_get['page'] == "page1") { echo "page1 content"; }
and on set links yourpage.com/index.php?page=about menu , on
php url dynamic
No comments:
Post a Comment