Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- config.php file
- <?php
- /*--Config--*/
- $db_name = "koncms";
- $db_user = "root";
- $db_pass = "dont look :O";
- $db_host = "localhost";
- //////////////////////////////
- define(DB_NAME, $db_name);
- define(DB_USER, $db_user);
- define(DB_PASS, $db_pass);
- define(DB_HOST, $db_host);
- //////////////////////////////
- ?>
- index.php file
- <html>
- <body>
- <?php
- include config.php;
- $con = mysql_connect(DB_HOST,DB_USER,DB_PASS);
- if (!$con)
- {
- die('Failed: ' . mysql_error());
- }
- else
- {
- echo "connected";
- }
- ?>
- </body>
- </html>
- error:
- root@home-System-Product-Name:/var/www/cms# php index.php
- <html>
- <body>
- PHP Notice: Use of undefined constant config - assumed 'config' in /var/www/cms/index.php on line 4
- PHP Notice: Use of undefined constant php - assumed 'php' in /var/www/cms/index.php on line 4
- PHP Warning: include(configphp): failed to open stream: No such file or directory in /var/www/cms/index.php on line 4
- PHP Warning: include(): Failed opening 'configphp' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/cms/index.php on line 4
- PHP Fatal error: Call to undefined function mysql_connect() in /var/www/cms/index.php on line 5
Add Comment
Please, Sign In to add comment