Page 1 of 1

php file upload

Posted: Thu Apr 19, 2018 5:07 am
by carllwyman
I am a newbie to the world of webdesign and my experience is one website old.I am reading the basic text books on php and viewing the tutorial videos on YouTube and have the following question.
The textbook advises me to code php along with html and save it as index.php and “ put it onto your php enabled server”—On which folder on the server am I supposed to upload my index.php file to.There is also an index.html file which contains the same html code excepting the php part which I have uploaded to public_ html folder on the server.
When it comes to running the webpage which of these two files will have precedence-?
Can anyone explain my problem?
Regards,

Re: php file upload

Posted: Thu Apr 19, 2018 7:03 am
by protopatterns
carllwyman wrote:On which folder on the server am I supposed to upload my index.php file to
public_html/
When it comes to running the webpage which of these two files will have precedence
It depends how the server is configured. But if you're programming in PHP, there's no need for anything to have an .html extension anymore, because PHP includes all of HTML.

Re: php file upload

Posted: Thu Apr 19, 2018 2:34 pm
by Christopher
carllwyman wrote:When it comes to running the webpage which of these two files will have precedence-?
You can confirm the setting by having both files in public_html/ and see which one is displayed. In the end, you should only have one of them in the directory.