include path geht nicht??
hi@all!
ich hb da ein forum downgeloadet und will es nun in ein gesamtsystem integrieren, aber die db-anbindung klappt nicht, obwohl das unverständlich ist:
also meine datei im hauptverz. heisst
und schaut so aus:
die verbindungsdatei im ordner forum
und schaut so aus:
ok ich hab also connect.php in dbconnect.php included und in der dbconnect.php folgendes verändert:
dann kommen folgende errors mir völlig unverstänlich:
BITTE HILFE, weil der absolute serverpfad auch nichts hilft??
... obwohl der absolute pfad wäre nicht dienlich!!!!!!!!!!!!!!!!
ich hb da ein forum downgeloadet und will es nun in ein gesamtsystem integrieren, aber die db-anbindung klappt nicht, obwohl das unverständlich ist:
also meine datei im hauptverz. heisst
|
|
PHP-Quelltext |
1 |
connect.php
|
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 |
<?php
$mysqlhost = "mysql1.nefserver.lan";
$mysqluser = "user";
$mysqlpassword = "pw";
$mysqldb = "dnname";
$con= @mysql_connect($mysqlhost,$mysqluser,$mysqlpassword);
$mysqldb = @mysql_select_db($mysqldb,$con);
?>
|
die verbindungsdatei im ordner forum
|
|
PHP-Quelltext |
1 |
dbconnect.php
|
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 |
<?php
$db_host = "mysql1.nefserver.lan";
$db_user = "user";
$db_pass="pw" ;
$db_name = "dnname";
$db_prefix = "";
$db_suffix = "";
?>
|
ok ich hab also connect.php in dbconnect.php included und in der dbconnect.php folgendes verändert:
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 |
<?php include "../../connect.php";
$mysqlhost = $db_host;
$mysqluser = $db_user;
$mysqlpassword = $db_pass ;
$mysqldb =$db_name;
$db_prefix = "";
$db_suffix = "";
?>
|
dann kommen folgende errors mir völlig unverstänlich:
Zitat
Warning: main(): Unable to access ../../connect.php in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(../../connect.php): failed to open stream: No such file or directory in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(): Failed opening '../../connect.php' for inclusion (include_path='.:/usr/share/php') in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(): Unable to access ../../connect.php in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(../../connect.php): failed to open stream: No such file or directory in /home/www/web42/html/forum/include/dbconnect.php on line 1
BITTE HILFE, weil der absolute serverpfad auch nichts hilft??
... obwohl der absolute pfad wäre nicht dienlich!!!!!!!!!!!!!!!!
Im Leben gibt man nur Briefe auf, sonst nix!
www.realtype.org
www.realtype.org
die pfade zum includen gehen immer von der 1. datei aus, in die sie includet werden!
gib den pfad am besten absolut an, dann bekommst du mit solchen dingen keine probleme mehr.
oder lass einfach mal die ../../ weg
gib den pfad am besten absolut an, dann bekommst du mit solchen dingen keine probleme mehr.
oder lass einfach mal die ../../ weg
Über mich: www.heinervdm.de
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
sorry, aber wenn ich die ../../ weglasse sagt er das:
zeile 39 ist folgende in einem teil dieser seite (rut im code):
$db = $db_name;
}
if ($this->con == 0) $this->error->sql_error("NOCON",__FILE__,__LINE__);
if (mysql_select_db($db, $this->con)) {
$this->db = $db;
return true;
}
else $this->error->sql_error("CNCON",__FILE__,__LINE__);
}
... absoluter pfad geht nicht, weil die connect.php von jedem die daten gewusst werden, kaum aber der absolute pfad, aber wie dann eine install-routine machen???
Zitat
Warning: main(connect.php): failed to open stream: No such file or directory in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(): Failed opening 'connect.php' for inclusion (include_path='.:/usr/share/php') in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(connect.php): failed to open stream: No such file or directory in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(): Failed opening 'connect.php' for inclusion (include_path='.:/usr/share/php') in /home/www/web42/html/forum/include/dbconnect.php on line 1
Fehlernummer:1
Fehler: Eine Datenbankverbindung konnte nicht hergestellt werden, bitte überprüfen sie die Einstellungen.
Datei: /home/www/web42/html/forum/include/class/sql.cls.php
Zeile: 39
zeile 39 ist folgende in einem teil dieser seite (rut im code):
$db = $db_name;
}
if ($this->con == 0) $this->error->sql_error("NOCON",__FILE__,__LINE__);
if (mysql_select_db($db, $this->con)) {
$this->db = $db;
return true;
}
else $this->error->sql_error("CNCON",__FILE__,__LINE__);
}
... absoluter pfad geht nicht, weil die connect.php von jedem die daten gewusst werden, kaum aber der absolute pfad, aber wie dann eine install-routine machen???
Im Leben gibt man nur Briefe auf, sonst nix!
www.realtype.org
www.realtype.org
|
|
PHP-Quelltext |
1 |
include substr($SCRIPT_FILENAME,0,strrpos($SCRIPT_FILENAME,"/"))."../../connect.php";
|
probier mal das...
Über mich: www.heinervdm.de
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »heinervdm« (22. Februar 2004, 17:57)
sorry er sagt noch immer folgendes:
Zitat
Warning: main(): Unable to access ../../connect.php in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(../../connect.php): failed to open stream: No such file or directory in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(): Failed opening '../../connect.php' for inclusion (include_path='.:/usr/share/php') in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(): Unable to access ../../connect.php in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(../../connect.php): failed to open stream: No such file or directory in /home/www/web42/html/forum/include/dbconnect.php on line 1
Warning: main(): Failed opening '../../connect.php' for inclusion (include_path='.:/usr/share/php') in /home/www/web42/html/forum/include/dbconnect.php on line 1
Fehlernummer:1
Fehler: Eine Datenbankverbindung konnte nicht hergestellt werden, bitte überprüfen sie die Einstellungen.
Datei: /home/www/web42/html/forum/include/class/sql.cls.php
Zeile: 39
Im Leben gibt man nur Briefe auf, sonst nix!
www.realtype.org
www.realtype.org
Ähnliche Themen
-
Allgemeines Forum »-
WEB.DE son shit
(5. August 2003, 13:19)
-
Provider & Webspace »-
Web.de
(24. Juni 2003, 14:25)
-
PHP »-
Wie macht man das richtig???
(11. Februar 2003, 23:58)
-
PHP »-
include.php?path=test.php ???
(28. November 2002, 14:42)


