Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'config.inc.php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 2 results

  1. I have spent several months trying to teach myself web programming. I've managed to create a pretty cool dynamic website that works OK - so far. Then I found this great book. I am now trying to incorporate some of these important ideas into my code. My first attempt was to use the ideas behind the use of the config.inc.php and mysqli_connect.php files as explained in CH 18. This became a disaster as I tried various schemes to make it work which caused me to revert to the previously saved version of my code and start over. Before I do I'd like to be sure I have a clear understand of what I'm trying to do. The four 'connect' parameters are 'defined' as constants in the mysqli_connect.php file. In the config.inc.php file I defined the constant MYSQL as the path to this mysqli_connect.php file. As I read chapter 18 it says that I can now - require MYSQL; - in any script where I need to connect to the database. Questions: 1) When I run the app I get an error saying that I can not redefine a constant. The mysqli-connect.php file does attempt to re-define the four connect constants every time it is run in a script where it was 'included' and so the error is totally expected. What am I not getting here? 2) If I 'include' this file many times in scripts that echo html to the browser would not the connect constants then appear on my pages and be readable to anyone who wishes to "view source" in their browser? I'm sure I'm missing some important basic concept here. Some more info that might be relevant: I created a 'config' folder in both my localhost xampp development environment and on my GoDaddy server account right under the root directory. In both accounts I keep the config.inc.php file in there. In the local account I have placed the mysqli_connect.php file in the same config folder. In the GoDaddy account I placed it in a directory just above the root. This way in the config.inc.php the 'define MYSQL' path is different in each account and point to the respective locations for the mysqli_connect.php file. All files except 'config.inc.php' in the app can be the same this way. To migrate working code to the online account as I make improvements I just move all folders under the root in the xampp account to the GoDaddy server under the 'public_html' folder - except for the config folder which I should never have to touch. 3) Is this the correct way to do this? Regarding questions 1 and 2, I realize I have some very basic misunderstanding but I can't figure out what it is. Thanks.
  2. define ('BASE_URI', '/c:/xampp/htdocs/');----------I am Window 7 user and is this the right path ? define ('BASE_URL', 'www.example.com/'); define ('PDFS_DIR', BASE_URI . 'pdfs/'); // Added in Chapter 5. define ('MYSQL', BASE_URI . 'mysql.inc.php'); Hi (Larry)all, thanks for helping me
×
×
  • Create New...