php file upload

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
carllwyman
Forum Newbie
Posts: 1
Joined: Thu Apr 19, 2018 5:02 am

php file upload

Post 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,
protopatterns
Forum Newbie
Posts: 9
Joined: Sun Jan 28, 2018 11:18 am

Re: php file upload

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: php file upload

Post 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.
(#10850)
Post Reply