redirect - Page navigation with php -
i trying create dynamic website, index.php includes following code in content area of website:
<?php // if undefined define if(!$od || $od == ""){ $od = "news"; } // check if exists prep $link = 'incs'."/".$od.$ext; flush(); $fp = fopen($link, "r"); // check if inclusion file not exists return error if (!$fp) { echo "an error has ocurred while processing request. file linked ?od=".$od." not appear exist."; } // if exists return parse else { fclose($fp); include 'incs'."/".$od.$ext; } echo '</body>'."\n"; echo '</html>'."\n"; ?>
i have various links throughout site pages register, login, etc. links point pages ?od=register, ?od=login, etc.
the website pull default file me, news, , display in content section of website, when click register, url in address bar change /?od=register, default news remains in content section, there error in code above? or missing something?
p.s. $ext
defined in config file inc.php
, included @ top of index page.
besides fact insecure - making request, access variables through $_get
array ie $od = $_get['od']
Comments
Post a Comment