Jump to content

Xingyiman

New Members
  • Posts

    2
  • Joined

  • Last visited

Xingyiman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey everybody, just found this forum and thought I'd introduce myself! I've coded in a number of different languages, but never done any kind of server side programming or web programming other than a bit of html and css in an intro class awhile back. Anyway, my mother wants a website for her art business, so being the programmer in the family I figured I'd make that for her. Also, after that project is finished, I'm going to go ahead and make an online programming portfolio/resume that I can show off, that will hopefully help me get some work. I've only been a hobbyist up to this point, though I've been programming for years. My current retail career is going nowhere though, so it's time for a change ;-)
  2. Thanks! I see what the book was saying now. It mentioned security, so using the $_SERVER['DOCUMENT'] variable to get the root directory and putting the file in a folder one directory above the root (the parent directory of the root) takes the potentially sensitive information out of the main tree of the website and accesses it with a relative path, which makes it more secure than using a direct path in the site tree.
  3. 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.