Home>

Guys, please please understand. I understand the programming very badly, and therefore I appeal to you. I can't connect to MySQL. When you type http in the browser: //Syt.ru/install.php, a page with windows to enter the connection data to MySQL opens. But when I enter, dbHost: localhost, dbuserName: username, DBPASS: Password, DBName: Database Name And I press the button further, the page is simply updated and proposes to enter the data again. Who knows, please tell me what's the matter? Perhaps in "Install.php" need to register something, or change? I will be very grateful for any hint. Here is the script:

<
?
Error_Reporting (0);
if ($ state== "") {
Echo "<
CENTER >
≪
B >
Installation and configuration of casino scripts, step 1 <
/b >
≪
BR >
≪
BR >
";
Echo "Before installing installation, create an empty database on your server, <
BR >
 and enter the parameters for connected below <
/CENTER >
≪
Table Border= \ "0 \" Align= \ "Center \" CellPadding= \ "0 \" CellSpacing= \ "10 \" >
≪
Form Action= Install.php Method= Post >
≪
TR >
≪
TD >
DB Host <
/TD >
≪
TD >
≪
INPUT SIZE= 20 NAME= HOST VALUE= Localhost >
≪
/TD >
≪
/TR >
≪
TR >
≪
TD >
Db username <
/TD >
≪
TD >
≪
INPUT SIZE= 20 NAME= User >
≪
/TD >
≪
/TR >
≪
TR >
≪
TD >
DB Password <
/TD >
≪
TD >
≪
INPUT SIZE= 20 NAME= PASS >
≪
/TD >
≪
/TR >
≪
TR >
≪
TD >
DB Name <
/TD >
≪
TD >
≪
INPUT SIZE= 20 NAME= NAME >
≪
/TD >
≪
/TR >
≪
TR >
≪
TD >
≪
INPUT TYPE= HIDDEN VALUE= 1 NAME= STATE >
 ≪
INPUT TYPE= Submit Value= \ "Next ... \" >
≪
/TD >
≪
/TR >
≪
/Form >
≪
/Table >
≪
H2 >
ATTENTION !!! <
/h2 >
≪
B >
Before installing, find the setup.php file and give it the right to write (777) <
/b >
";
exit;
}
if ($ state== "1") {
$ FR= Fopen ("setup.php", "w +");
FWRITE ($ FR, '<
'. "? \ n");
FWRITE ($ FR, 'error_Reporting (0);' "\ n");
FWRITE ($ FR, '$ dbhost= "'. $ Host. '"; "" \ n ");
FWRITE ($ FR, '$ dbuname= "'. $ User. '";' "\ n");
FWRITE ($ FR, '$ dbpass= "'. $ pass. '";' "\ n");
FWRITE ($ FR, '$ dbname= "'. $ Name. '";' "\ n");
FWRITE ($ FR, 'MySQL_Connect ($ dbhost, $ dbuname, $ dbpass) or DIE ("<
BR >
≪
BR >
≪
CENTER >
≪
BR >
≪
BR >
≪
B >
Sorry, but at the moment there is a problem with connecting to MySQL server. ≪
BR >
≪
BR >
We apologize, ask you to go a little later. ≪
/CENTER >
≪
/b >
"); '." \ n ");
FWRITE ($ FR, 'MySQL_SElect_DB ($ dbName);'. "\ n");
FWRITE ($ FR, '?'. '>
');
FClose ($ FR);
ECHO "Creating a settings file ..... OK <
BR >
";

Next tables.

"Localhoss" -typo?

Макс Жуков2021-04-06 08:27:05

Write to me in Skype (GT_FIOS) such an elementary to explain really for a long time and hard .. it is better to do it ..

Aios2021-04-06 08:27:05

And the database itself on the MYSQL server is created ???

gart672021-04-06 08:27:05

@Mazhor, show the installation.php code.

Эмиль Сабитов2021-04-06 08:27:05

The database is created and works fine. Another engine is connected and the one that I need not.

mazhor2021-04-06 08:27:05
  • Answer # 1

    And where does the variable gets the value $ State ?

    Try after Error_Reporting (0); Add $ state= $ _ post ["state"] .

  • Answer # 2

    As already said Gart67 variable $ State You are taken from the ceiling. Take the existence of the existence of State in the array $ _Post. . If it exists, then you will define the code of your condition (referring to the configuration variables, too via POST), otherwise output for filling. P.S. Error_Reporting It is better to turn on, you don't have this business on production?