Quantcast
Channel: Spiceworks Community
Viewing all articles
Browse latest Browse all 20

Dynamic Content changed when link is clicked?

$
0
0


PHP
$contentPages=array('contact_form'=>'contact_form.php','welcome'=>'welcome.php','about'=>'about.php');$content='default.php';if(isset($_GET['content'])&&array_key_exists($_GET['content'],$contentPages)){$content=$contentPages[$_GET['content']];}include('html/'.$content);

Just to offer another solution, this can be done with pure PHP if you want to avoid using JavaScript, jQuery, etc. Please note, this is for reference and should not be used as is. You would want to sanitize the GET variable rather than trusting users.


Viewing all articles
Browse latest Browse all 20

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>