I am going to create a new site for my company, and I am trying to implement the switch navigation that I used on all my sites in the past.
<?php switch($x) { default: include("inc/main.php"); break; case "products": include("inc/products.php"); break; } ?>
For some reason, when do I go to index.php? x = nothing happens, it still displays inc / main.php, in other words, it did not find the X variable from the url. Is this related to global variables?
Yes, your configuration PHP has correctly received register_globalsis disabled because it is incredibly dangerous.
register_globals
Just put:
$x = $_REQUEST['x']
at the top of your script.
$_GET, , GET HTTP. , , $_REQUEST - , , .
$_GET
GET
$_REQUEST
, - register_globals, . PHP 6.0! switch($_GET['x']) {.
switch($_GET['x']) {
$_GET . register_globals, , .
You can use http://php.net/manual/es/function.extract.php to extract variables if you want to do this, but keep in mind that this allows any user to set variables with the content that they want in your script, which makes it as volatile as using register_globals
Source: https://habr.com/ru/post/1699044/More articles:Creating an NHibernate Object and Initializing a Set - mappingRibbon interface for Visual Studio 2010 or beyond? - user-interfaceBest way to deploy and link to an XSLT file - visual-studioFix browser errors, how do you go or save them to the end? - debuggingHow to specify color in configuration - c #How can I check if I am in a debug or release build in a web application? - debuggingТип несоответствия с дженериками - javaHow to handle microphone input in real time? - winapiASP.NET Website / Hosting - asp.nethttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1699049/how-do-i-convert-dts-packages-to-ssis-packages&usg=ALkJrhgVKVajwOkiGPC-ZMEElxOtXiB7fAAll Articles