Warning Nu esti autentificat. Te rog autentifica-te sau inregistreaza-te pentru a avea acces la toate facilitatile forumului.
SkullBox  
Noiembrie 22, 2008, 04:59:30 pm
Bine ai venit, Vizitator. Trebuie să te autentifici sau să îţi creezi un cont.
Ai pierdut sau nu ai primit emailul care conţine codul de activare al contului?

Autentifică-te cu numele de utilizator, parola şi precizează durata sesiunii.
Noutăţi: ImageSL - Gazduire de imagini, gratuita
 
 SkullBoxDirector webTutoriale  Pagina principală   Ajutor Caută Autentificare Creează un cont  
Pagini: [1]
  Imprimă  
Subiect: O mica problema cu un script  (Citit de 577 ori)
0Utilizatori şi 1 Vizitatori
rila
Full Member
***
Deconectat Deconectat

Mesaje: 202


O mica problema cu un script, Octombrie 17, 2007, 07:32:44 pm

Nu de curand am luat de pe un site de scripturi php un script de autentificare pentru site ...... la-m uploadat pe server, totu bine si frumos....pana a venit partea de config.....trebuie sa bag datele mele de mysql si nu prea inteleg unde.
Codul este:
Cod:
<?php

$config_file 
'./gacl.ini.php';

require_once(
'./admin/gacl_admin.inc.php');
require_once(
ADODB_DIR .'/adodb-xmlschema.inc.php');

$db_table_prefix $gacl->_db_table_prefix;
$db_type $gacl->_db_type;
$db_name $gacl->_db_name;
$db_host $gacl->_db_host;
$db_user $gacl->_db_user;
$db_password $gacl->_db_password;
$db_name $gacl->_db_name;

$failed 0;

echo 
'<h1>phpGACL Database Setup</h1>
<p><b>Configuration:</b><br/>
driver = <b>'
.$db_type.'</b>,<br/>
host = <b>'
.$db_host.'</b>,<br/>
user = <b>'
.$db_user.'</b>,<br/>
database = <b>'
.$db_name.'</b>,<br/>
table prefix = <b>'
.$db_table_prefix.'</b></p>';

function 
echo_success($text) {
echo '<font color="green"><b>Success!</b></font> '.$text."<br/>\n";
}

function 
echo_failed($text) {
global $failed;
echo '<font color="red"><b>Failed!</b></font> '.$text."<br/>\n";
$failed++;
}

function 
echo_normal($text) {
echo $text."<br/>\n";
}

/*
 * Test database connection
 */
echo '<hr/><h2>Testing database connection...</h2>'."\n";

if (
is_resource($db->_connectionID)) {
echo_success('Connected to "<b>'.$db_type.'</b>" database on "<b>'.$db_host.'</b>".');
} else {
echo_failed('<b>ERROR</b> connecting to database,<br/>
are you sure you specified the proper host, user name, password, and database in <b>admin/gacl_admin.inc.php</b>?<br/>
Did you create the database, and give read/write permissions to "<b>'
.$db_user.'</b>" already?');
exit;
}

/*
 * Do database specific stuff.
 */
echo '<hr/><h2>Testing database type...</h2>'."\n";

switch ( 
$db_type ) {
case ($db_type == "mysql" OR $db_type == "mysqlt" OR $db_type == "maxsql" ):
echo_success("Compatible database type \"<b>$db_type</b>\" detected!");
echo_normal("Making sure database \"<b>$db_name</b>\" exists...");

$databases $db->GetCol("show databases");

if (in_array($db_name$databases) ) {
echo_success("Good, database \"<b>$db_name</b>\" already exists!");
} else {
echo_normal("Database \"<b>$db_name</b>\" does not exist!");
echo_normal("Lets try to create it...");

if (!$db->Execute("create database $db_name") ) {
echo_failed("Database \"<b>$db_name</b>\" could not be created, please do so manually.");
} else {
echo_success("Good, database \"<b>$db_name</b>\" has been created!!");

//Reconnect. Hrmm, this is kinda weird.
$db->Connect($db_host$db_user$db_password$db_name);
}
}

break;
case ( $db_type == "postgres8" OR $db_type == "postgres7" ):
echo_success("Compatible database type \"<b>$db_type</b>\" detected!");

echo_normal("Making sure database \"<b>$db_name</b>\" exists...");

$databases $db->GetCol("select datname from pg_database");

if (in_array($db_name$databases) ) {
echo_success("Good, database \"<b>$db_name</b>\" already exists!");
} else {
echo_normal("Database \"<b>$db_name</b>\" does not exist!");
echo_normal("Lets try to create it...");

if (!$db->Execute("create database $db_name") ) {
echo_failed("Database \"<b>$db_name</b>\" could not be created, please do so manually.");
} else {
echo_success("Good, database \"<b>$db_name</b>\" has been created!!");

//Reconnect. Hrmm, this is kinda weird.
$db->Connect($db_host$db_user$db_password$db_name);
}
}

break;

case "oci8-po":
echo_success("Compatible database type \"<b>$db_type</b>\" detected!");

echo_normal("Making sure database \"<b>$db_name</b>\" exists...");

$databases $db->GetCol("select '$db_name' from dual");

if (in_array($db_name$databases) ) {
echo_success("Good, database \"<b>$db_name</b>\" already exists!");
} else {
echo_normal("Database \"<b>$db_name</b>\" does not exist!");
echo_normal("Lets try to create it...");

if (!$db->Execute("create database $db_name") ) {
echo_failed("Database \"<b>$db_name</b>\" could not be created, please do so manually.");
} else {
echo_success("Good, database \"<b>$db_name</b>\" has been created!!");

//Reconnect. Hrmm, this is kinda weird.
$db->Connect($db_host$db_user$db_password$db_name);
}
}

break;

case "mssql":
echo_success("Compatible database type \"<b>$db_type</b>\" detected!");

echo_normal("Making sure database \"<b>$db_name</b>\" exists...");

$databases $db->GetCol("select CATALOG_NAME from INFORMATION_SCHEMA.SCHEMATA");

if (in_array($db_name$databases) ) {
echo_success("Good, database \"<b>$db_name</b>\" already exists!");
} else {
echo_normal("Database \"<b>$db_name</b>\" does not exist!");
echo_normal("Lets try to create it...");

if (!$db->Execute("create database $db_name") ) {
echo_failed("Database \"<b>$db_name</b>\" could not be created, please do so manually.");
} else {
echo_success("Good, database \"<b>$db_name</b>\" has been created!!");

//Reconnect. Hrmm, this is kinda weird.
$db->Connect($db_host$db_user$db_password$db_name);
}
}

break;

default:
echo_normal("Sorry, <b>setup.php</b> currently does not fully support \"<b>$db_type</b>\" databases.

I'm assuming you've already created the database \"$db_name\", attempting to create tables.

 Please email <b>$author_email</b> code to detect if a database is created or not so full support for \"<b>$db_type</b>\" can be added."
);
}


/*
 * Attempt to create tables
 */
// Create the schema object and build the query array.
$schema = new adoSchema($db);
$schema->SetPrefix($db_table_prefixFALSE); //set $underscore == FALSE

// Build the SQL array
$schema->ParseSchema('schema.xml');

// maybe display this if $gacl->debug is true?
if ($gacl->_debug) {
print "Here's the SQL to do the build:
\n<code>"
;
print $schema->getSQL('html');
print "</code>\n";
// exit;
}

// Execute the SQL on the database
#ADODB's xmlschema is being lame, continue on error.
$schema->ContinueOnError(TRUE);
$result $schema->ExecuteSchema();

if (
$result != 2) {
  
echo_failed('Failed creating tables. Please enable DEBUG mode (set it to TRUE in $gacl_options near top of admin/gacl_admin.inc.php) to see the error and try again. You will most likely need to delete any tables already created.');
}

if ( 
$failed <= ) {
echo_success('
Installation Successful!!!
<div align="center">
<font color="red"><b>*IMPORTANT*</b></font><br/>
<p>Please make sure you create the <b><phpGACL root>/admin/templates_c</b> directory,
and give it <b>write permissions</b> for the user your web server runs as.</p>
<p>Please read the manual, and docs/examples/* to familiarize yourself with phpGACL.</p>
<a href="admin/about.php?first_run=1"><b>Let\'s get started!</b></a>
</div>
'
);
} else {
echo_failed('Please fix the above errors and try again.');
}
?>


Va rog sa-mi spuneti si mie unde trebuie sa bag parola numele si adresa bazei de date,sunt o gramada de dbase user si password si adress in scriptul asta si nu inteleg unde trebuie sa le pun.
Memorat
Mike
Global Moderator
Hero Member
*****
Deconectat Deconectat

Gen: Bărbat
Mesaje: 784



WWW
O mica problema cu un script, Octombrie 17, 2007, 08:37:35 pm

Presupun ca la inceput, in
Cod:
$db_table_prefix = $gacl->_db_table_prefix;
$db_type = $gacl->_db_type;
$db_name = $gacl->_db_name;
$db_host = $gacl->_db_host;
$db_user = $gacl->_db_user;
$db_password = $gacl->_db_password;
$db_name = $gacl->_db_name;
Memorat

rila
Full Member
***
Deconectat Deconectat

Mesaje: 202


O mica problema cu un script, Octombrie 17, 2007, 08:57:23 pm

am incercat si nu merge nu se pune acolo...in alta parte dar nu stiu unde..........
Memorat
AdyX
Bagabond
Global Moderator
Hero Member
*****
Deconectat Deconectat

Gen: Bărbat
Mesaje: 987


WWW
O mica problema cu un script, Octombrie 17, 2007, 09:02:45 pm

Ai incercat sa arunci o privire in fisierul gacl.ini.php? ...
Memorat
SOUL
Full Member
***
Deconectat Deconectat

Mesaje: 162



O mica problema cu un script, Octombrie 18, 2007, 05:06:39 am

Citat
/*
* Test database connection
*/
echo '<hr/><h2>Testing database connection...</h2>'."\n";

if (is_resource($db->_connectionID)) {
    echo_success('Connected to "<b>'.$db_type.'</b>" database on "<b>'.$db_host.'</b>".');
} else {
    echo_failed('<b>ERROR</b> connecting to database,<br/>
            are you sure you specified the proper host, user name, password, and database in <b>admin/gacl_admin.inc.php</b>?<br/>
            Did you create the database, and give read/write permissions to "<b>'.$db_user.'</b>" already?');
    exit;
}
In secventa asta de cod testeaza conexiunea si te intreaba daca ai specificat: hostul, userul, parola, baza de date in "gacl_admin.inc.php" si daca ai dat permisiunea de "read/write" la $db_user.
O posibilitate.
Bafta.
Memorat

Daca A reprezinta succesul in viata, atunci A este egal cu x plus y plus z. Munca reprezinta x; y inseamna joaca; iar z - sa stii sa-ti tii gura. ~ Albert Einstein
rila
Full Member
***
Deconectat Deconectat

Mesaje: 202


O mica problema cu un script, Octombrie 18, 2007, 04:10:40 pm

Multumesc pentru ajutor dar l-am lasat balta....am rezolvat problema cu scrisul datelor dar....am lasat acest script....este prea greu de instalat din mysql si simcer............nu merita efortul.
Offtopic:Imi puteti recomanda un script bun care sa fie si de management?Adica sa pot pune restrict pe o pagina pe care vreau sa o vada decat userii inregistrati sau sa ceara logare.Daca stiti va rog sa imi spuneti!
Memorat
emj
Sr. Member
****
Deconectat Deconectat

Mesaje: 454



WWW
O mica problema cu un script, Octombrie 18, 2007, 07:26:28 pm

Dar stai putin..daca e se cere o parola si un user atunci unde se vor tine datele fiecarui user??..daca nu intr-o baza de date.
Memorat

Gadgetinho - IT cu zambetul pe buze
Mondenitati - Discutii cu si despre muzica si cinematografie... si monden.
HostGator
Newbie
*
Mesaje: Multe

Reclamă cu aligatori
 

Ai auzit de aligatorul care ofera hosting?
 
   
Pagini: [1]
  Imprimă  
 
Schimbă forumul:  

Creat cu MySQL Creat cu PHP Ethical hacking and programming community Director web romanesc cu inscriere gratuita Validat cu XHTML 1.0! Validat cu CSS!
IPFind, FAQDB, LAMP.ro, Good Proxy, Aberez.EU, RoFreeSBIE, ShockingSoft.com, HostVision, Invatam.net, PC Troubleshooting, Curs valutar online
Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
Traducerea în limba română © 2006-2007 www.smf.ro