Jump to content
Fórum Script Brasil
  • 0

Duvida Com servirdor


Igoh Bruno

Question

Boa noite

Estou com um script aqui que ele tem esse arquivo de config para a área de administração

mais tou meio errolado nessa parte aqui:

if ($HTTP_SERVER_VARS["REMOTE_ADDR"]!= "127.0.0.1"){

$cfgServerHost = 'sql5a877545sa.carrierzone.com'; // MySQL hostname

eu não uso localhost e sim o servidor sql5a877545sa.carrierzone.com

como faço para chamar esse serve na condição assim. REMOTE_ADDR

e meio enrrolado mais alguém pode mim ajudar?

Código Completo:

<?

$cfgIndexpage = 'index.php';

// page to go to, if login is cancelled

// Example: if your main page is http://www.mydomain.com/index.php

// the value would be $cfgIndexpage = '/index.php'

$admEmail = 'igohbruno@gmail.com';

// E-mail adres of the site administrator

// (This is being showed to the users on an error, so you can be notified by the users)

$noDetailedMessages = true;

// Show detailed error messages (false) or give one single message for all errors (true).

// If set to 'false', the error messages shown to the user describe what went wrong.

// This is more user-friendly, but less secure, because it could allow someone to probe

// the system for existing users.

$passwordEncryptedWithMD5 = false; // Set this to true if the passwords are encrypted

// with the MD5 algorithm

// (not yet implanted, expect this in a next release)

$languageFile = 'brazil.php'; // Choose the language file

$bgImage = 'bg_lock.gif'; // Choose the background image

$bgRotate = false; // Rotate the background image from list

// (This overrides the $bgImage setting)

/****** Lists ******/

// List of backgrounds to rotate through

$backgrounds[]= 'bg_lock.gif';

$backgrounds[] = 'bg_lock2.gif';

$backgrounds[] = 'bg_gun.gif';

/****** Database ******/

$useDatabase = true; // choose between using a database or data as input

/* this data is necessary if a database is used */

if ($HTTP_SERVER_VARS["REMOTE_ADDR] != "127.0.0.1"){

$cfgServerHost = 'sql5c75a.carrierzone.com'; // MySQL hostname

$cfgServerPort = ''; // MySQL port - leave blank for default port

$cfgServerUser = 'salaopera'; // MySQL user

$cfgServerPassword = 'senha'; // MySQL password

$cfgDbDatabase = 'phpmy1_salao_com_br5ds45s4d'; // MySQL database name containing phpSecurePages table

} else {

$cfgServerHost = 'sql5c75a.carrierzone.com'; // MySQL hostname

$cfgServerPort = ''; // MySQL port - leave blank for default port

$cfgServerUser = 'salaopera'; // MySQL user

$cfgServerPassword = 'senha'; // MySQL password

$cfgDbDatabase = 'phpmy1_salao_com_br5ds45s4d'; // MySQL database name containing phpSecurePages table

}

$cfgDbTableUsers = 'users'; // MySQL table name containing phpSecurePages user fields

$cfgDbLoginfield = 'salaopera'; // MySQL field name containing login word

$cfgDbPasswordfield = 'senha'; // MySQL field name containing password

$cfgDbUserLevelfield = 'userlevel'; // MySQL field name containing user level

// Choose a number which represents the category of this users authorization level.

// Leave empty if authorization levels are not used.

// See readme.txt for more info.

$cfgDbUserIDfield = 'primary_key'; // MySQL field name containing user identification

// enter a distinct ID if you want to be able to identify the current user

// Leave empty if no ID is necessary.

// See readme.txt for more info.

/****** Database - PHP3 ******/

/* information below is only necessary for servers with PHP3 */

$cfgDbTableSessions = 'phpsp_sessions';

// MySQL table name containing phpSecurePages sessions fields

$cfgDbTableSessionVars = 'phpsp_sessionvars';

// MySQL table name containing phpSecurePages session variables fields

/****** Data ******/

$useData = false; // choose between using a database or data as input

/* this data is necessary if no database is used */

$cfgLogin[1] = 'salaopera'; // login word

$cfgPassword[1] = 'senha'; // password

$cfgUserLevel[1] = '1'; // user level

// Choose a number which represents the category of this users authorization level.

// Leave empty if authorization levels are not used.

// See readme.txt for more info.

$cfgUserID[1] = ''; // user identification

// enter a distinct ID if you want to be able to identify the current user

// Leave empty if no ID is necessary.

// See readme.txt for more info.

$cfgLogin[2] = '';

$cfgPassword[2] = '';

$cfgUserLevel[2] = '';

$cfgUserID[2] = '';

$cfgLogin[3] = '';

$cfgPassword[3] = '';

$cfgUserLevel[3] = '';

$cfgUserID[3] = '';

/**************************************************************/

/* End of phpSecurePages Configuration */

/**************************************************************/

// https support

if (getenv("HTTPS") == 'on') {

$cfgUrl = 'https://';

} else {

$cfgUrl = 'http://';

}

// getting other login variables

$cfgHtmlDir = $cfgProgDir;

if ($message) $messageOld = $message;

$message = false;

// Create a constant that can be checked inside the files to be included.

// This gives an indication if secure.php has been loaded correctly.

define("LOADED_PROPERLY", true);

// include functions and variables

function admEmail() {

// create administrators email link

global $admEmail;

return("<A HREF=mailto:$admEmail'>$admEmail</A>");

}

include($cfgProgDir . "lng/" . $languageFile);

include($cfgProgDir . "session.php");

// choose between login or logout

if ($logout && !($HTTP_GET_VARS["logout] || $HTTP_POST_VARS["logout"])) {

// logout

include($cfgProgDir . "logout.php");

} else {

// loading login check

include($cfgProgDir . "checklogin.php");

}

echo $HTTP_GET_VARS["logout"];

?>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

/* this data is necessary if a database is used */
if ($HTTP_SERVER_VARS["REMOTE_ADDR"] != "127.0.0.1"){
$cfgServerHost = 'sql5c75a.carrierzone.com'; // MySQL hostname
$cfgServerPort = ''; // MySQL port - leave blank for default port
$cfgServerUser = 'salaopera'; // MySQL user
$cfgServerPassword = 'senha'; // MySQL password
$cfgDbDatabase = 'phpmy1_salao_com_br5ds45s4d'; // MySQL database name containing phpSecurePages table
} else {
$cfgServerHost = 'sql5c75a.carrierzone.com'; // MySQL hostname
$cfgServerPort = ''; // MySQL port - leave blank for default port
$cfgServerUser = 'salaopera'; // MySQL user
$cfgServerPassword = 'senha'; // MySQL password
$cfgDbDatabase = 'phpmy1_salao_com_br5ds45s4d'; // MySQL database name containing phpSecurePages table
}
pelo que entendi do script esta parte que quer mudar é para se conectar ao mysql voce vai usar em dois servidores? se não pode remover isto, não precisa ficar repetindo os dados, e colocar só
$cfgServerHost = 'sql5c75a.carrierzone.com'; // MySQL hostname
$cfgServerPort = ''; // MySQL port - leave blank for default port
$cfgServerUser = 'salaopera'; // MySQL user
$cfgServerPassword = 'senha'; // MySQL password
$cfgDbDatabase = 'phpmy1_salao_com_br5ds45s4d'; // MySQL database name containing phpSecurePages table

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...