Someone secure for dynamic code information includes?

I found a few messages out there on how to dynamically change a php include to say

<? php require_once('.. / Connections/connStr_pots_db.php');? > to
<? php require_once('.. / Connections/connStr_pans_db.php');? >

using a $_SESSION, $_GET or $_POST etc. But since they are all so fearfully speak of security, and given that so many people want to know the deployable without wading through facts and yoke back together 15 screens of "almost correct", "corrected", 'Oops I forgot', 'Yes it's good, but here's your disaster... "forum messages, is - that someone (you know who) were all VERY SOLID and SECURE CODE by which we lesser mortals can remove the main php code (i.e. PRE - <!) DOCTYPE html PUBLIC "(-//W3C) from a dynamic page, save it as an include file, for 2 or more pages of php code head and then select the correct page dynamically passing parameters to the page destination.php, which would then show the correct information and we connected to the correct databases?"  It would be SOOO useful. I already understood how to get the code, save it, and reinsert it, it is the easiest part, but what about the rest?

As always,.

Thanks for the Forum from Adobe

The key to security on the basis of the output on dynamic parameters is to check that the setting is an expected value. For example:

session_start();
$valid = array('pots', 'pans');
if (isset($_SESSION['db']) && in_array($_SESSION['db'], $valid)) {
  require_once('../Connections/connStr_' . $_SESSION['db'] . '_db.php');
} else {
  header('Location: http://www.example.com/404.php');
  exit;
}

Tags: Dreamweaver

Similar Questions

Maybe you are looking for

  • How to decompress a download

    When I right click on the zip in my downloads folder I'm not given the possibility to decompress a download. How can I do? https://addons.Mozilla.org/Firefox/downloads/latest/426841/addon-426841-latest.xpi

  • Toshiba virtual store reset - 15992 account

    Sorry to ask again, but could you please reset again for some reason any does not accept my user name passwordThanks account number 15992

  • Can I install 2 hard drives in my HP Pavilion p6650z?

    We need to get a new hard drive, and I want to migrate EVERYTHING on the hard drive of origin to the new - not only files, but the OS and channels. My question: can I just install a second hard drive (internal) in the case of my p6650z? This would ma

  • Pavilion DV6-3030SD: Pavilion DV6-3030SD processor and HD upgrade

    Hello, I would like to know if I can pass for example the processor of my Pavilion DV6-3030SD with intel i3 M350 2, 27GHz and 2 hearts with every 4 GB of RAM (8GB total). Win10 64-bit is installed and works perfectly. I don't understand that a change

  • Free declaration space

    Hello My box of Equalogic complains of free space. 94% used. that leaves about 300 GB according to SAN HQ, but when I look at my sever cluster configuration, its telling me that I have 1.3 free to. I just wanted to check my understanding of this... A