Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

"$" used in $db_pass won't work

Hey, everyone! :D Merry Christmas!

Considering we use double quotes for $db_pass in config.php, everything inside them will be parsed by the PHP interpreter. This means "Pas$word" will actually be "Pas" because $word is not defined.

The solution is simple: replace the double quotes with apostrophes in setup.php and all the new installs will be able to use "$" in $db_pass.

CodeDownload  
                  $config = "<?php\n";
                  $config .= "// database settings\n";
                  $config .= "\$db_host = '".$db_host."';\n";
                  $config .= "\$db_user = '".$db_user."';\n";
                  $config .= "\$db_pass = '".$db_pass."';\n";
                  $config .= "\$db_name = '".$db_name."';\n";
                  $config .= "\$db_prefix = '".$db_prefix."';\n";
                  $config .= "define(\"DB_PREFIX\", \"".$db_prefix."\");\n";
                  $config .= "define(\"COOKIE_PREFIX\", \"".$cookie_prefix."\");\n";
                  $config .= "?>";

Nice, i wasn't even aware of this difference between " and '. Good solution.
Thread Information
Author
Replies
2 posts
Views
2,695 times
Last Post
Last updated on 6 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: kneekoo, JoiNNN