My site used to work with this code:
Code: Select all
<?php $vs = array('disclaimer', 'affiliate', 'linkus');
if( in_array($v, $vs) ) { include($vs);} else{ include "news/news.php";} ?>since that didn't work (even though it used to), I even tried a very basic code:
Code: Select all
<?php if($vs == "") { include "news/news.php"; } else { include "$vs"; } ?>my site used to work with either line of code until recently. i changed nothing in the coding, but my server did upgrade the PHP scripting/database to the most recent version. did something change that I wasn't aware of? How should I be coding this instead?
the general purpose that i used this line for was... if i specified the page in the URL, then i want that displayed in the body of the page. however, if no page is specified OR if a specified page is NOT in the array (meaning someone visiting the site is typing in random page URLs or trying to exploit the code) then i want it to return the default news page in the body.
can someone help? I'd appreciate it a lot, thanks in advance.