Using a dynamic include within a page
-
Hi all,
I am curious if there is a more efficient, seo, or safer way to allow wordpress to include within a page a dynamic php include. What I need is a way for a visitor to show specific content onclick within a page without navigating away from that page. I need the content show inline.
I have a dedicated blank space (sidebar area) that when the user currently clicks certain links within the content, it calls specific php content files and renders them within the page.
Can someone see if this code is valid or as I said before, safe?
Page Template includes this code:
<?php $page_choice = $_GET['service']; switch($page_choice) { case "structural": include ("structural.php"); break; default: echo "<p>We provide full service Building Engineering. Click on the individual services for more information.</p>"; } ?>Then, within the page text itself, I am hyperlinking images with:
<a href="services?load=x&service=structural">So this is changing the url and appending the sef url of “www.site.com/services” to “www.site.com/services?load=x&service=structural”
I could have sworn I read something about “user input dynamic include” being bad for some reason but my php kung fu is not so strong.
Any advice would be appreciated.
The topic ‘Using a dynamic include within a page’ is closed to new replies.