Jump to content
Larry Ullman's Book Forums

Finding My Apache Local Host for the "Include" Statements


Recommended Posts

I am a bit nervous that I may no be complying with the "How to Ask Questions the Smart Way", but alas...

1. This question is not the most directly related to the book.

2. This question is tangentially related to the book.

3. Under Oath, I swear I spent 90 minutes searching the internet forums for an answer which I now seek here.

==========================================================================================================

4. The reason for my post is to ask the following:

        QUESTION:  How may I call from an HTML file located on my desktop, then subsequently "include" a PHP file from my Apache "faux" local server on this same physical laptop...?

                            In other words, HTML is at place "A" IN my laptop, and I am trying to find the PHP file at place "B" IN my laptop.  

==========================================================================================================

5. The task I am attempting to mimic is a PHP YouTuber Instructor who was dragging an HTML file from his LOCAL machine and dropping it at his REMOTE server service.  He had two Windows explorer windows open.  He would click from the left Local window and drag the file to the right Remote window.

6. Currently, I must place all my HTML and PHP in the Apache Document Root:  "C:\xampp\htdocs" in order for the PHP scripts to perform properly.

7.  I believe it to be a more realistic replication of the "real world" if I were forced to call HTML from places other than the document root....or am I just urinating in to the wind?  Are indeed HTML files to be served from the document root with impunity?

8.  The laptop is a 2012-ish HewlettPackard Vision AMD Processor running Windows 8 Apache/Xampp version 3.2.2.

Link to comment
Share on other sites

I'm not entirely sure I follow what's going on or being asked here, but...

4. I don't know what it means to "call from an HTML file". You can load any HTML file anywhere in a browser but to run an HTML file through a URL, it has to be within Apache's document root. An HTML file cannot include a PHP script.

5. That sounds like you're observing a file transfer session, where they've logged into a remote server and then they drag-and-drop to transfer files. Apache, HTML, and PHP don't come into play here (i.e., you can file transfer any type of file).

6. That is correct.

7. Again, not sure what "call HTML" means but if you're using the web server application (e.g., Apache), to load a file through a URL it has to be in the web server document root.

Link to comment
Share on other sites

Hello Mr. Ullman

Thank you for your response.  I enjoy the way your have written this PHP for the Web 5th Ed Book.  I am just beyond beginner level and I appreciate that I am not compelled to download code as another PHP book not of PeachPress publishing forced me to do.  I also enjoy you and the publisher taking the page space and spending ink to show what the 'finished result' of a html or php file.  This is really helpful for debugging.  Okay! Time to cease violating a "How to Ask Questions the Smart Way"--> Groveling.

QUESTION ANSWERED: I take it that there is no to mimic a remote server if one has the "faux" server doing all the deeds.

What I should have shared in my original post: the PHP YouTube broadcaster would type in the address to his remote server on his local browser address window.  This is what I was attempting to replicate:  Ah html file at place "A" calling from a server in place "B".  But, now that I think about it, this issue is moot: even at a remote place for the server serving the html file, the 'place' the said file which the browser is calling up is probably is the document root anyway.  I surmise that it matters not WHERE the server IS, but WHERE the html file is located WITHIN the server.

Link to comment
Share on other sites

 Share

×
×
  • Create New...