Jump to content

Search the Community

Showing results for tags '$_server[document_root]'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Hallo phpfreaks, I`m new to this specific forum so I would like to contribute to some topics in the future. My question here is about absolute php paths. Right now I`m busy with making my own cms and I want to make it as flexible as possible. I`m not a fan of frameworks or library's so I`m making everything by myself (for this project). I already found a specific script that does exactly what I want to accomplish but I`m not so happy with that it uses $_SERVER['DOCUMENT_ROOT'] and this is the script that I found: substr( str_replace( '\\', '/', realpath(dirname(__FILE__))), strlen( str_replace( '\\', '/', realpath($_SERVER['DOCUMENT_ROOT'])))); At this moment I`m using Windows so this is the output that I get with it: /Projects/cms/5113/htdocs2 I was hoping that someone would know a alternative to the $_SERVER part. If it`s unclear what I`m trying to accomplish I`ll just write the whole story for you.
  2. So, I'm starting the book "PHP and MySQL Web Development 4th Edition" and have a question about some code from chapter 2. In the sample script you declare a variable $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT']; This is then used later when opening/creating a file for writing: @ $fp = fopen("$DOCUMENT_ROOT/../orders/orders.txt", 'ab'); Unfortunately, it gives me an error saying the directory doesn't exist. Now if I eliminate the /.. part of the path it works fine. I seem to be having a reading comprehension problem as the text says ".." is used to mean "the parent directory of the document root directory" and I'm not entire sure what this means. Right now my orders folder is in the same folder as my script that executes this command: /Applications/XAMPP/xamppfiles/htdocs/processorder.php
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.