/    Sign up×
Community /Pin to ProfileBookmark

index.php vs. index.html Editing

Hi,
I need to ask what must be a very basic question – apologies. I have a website where I upload/download files via FTP. I would like to edit the html code for a few pages but all I can see on my server via FTP client (FileZilla to be exact) is only php files – i.e. “index.php”.

Here’s where I’m confused – When I hit my homepage’s URL, right click and select view source I see the source for an html page with embedded php but I can’t find this index.[B]html [/B]page on my server in order to edit the html code. When I look at the code for index.php I see just that, only the php code but no html. When the index.php is accessed via URL where does the html part come from? Where can I find this html page in order to edit???

Again, sorry for the basic question and thanks in advance.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@gjerichFeb 14.2015 — hello roddick,

php code isn't shown in source code because it render html elements at server/host side... your index file is .php and generate html elements. very very [B]basic[/B] practice is something like this. for example:

file: test.php
[code=php]
<!-- at the top can be pure html -->
<!DOCTYPE html>
<html>
<head>
<!-- header elements -->
</head>
<bod>
<?php
echo '<h1>Hello friend</h1>';
?>
</body>
[/code]

this code will render pure html and in souce will look like
[code=php]
<!-- at the top can be pure html -->
<!DOCTYPE html>
<html>
<head>
<!-- header elements -->
</head>
<bod>
<h1>Hello friend</h1>
</body>
[/code]

p.s. php can be placed anywhere you want. header, body, footer... it depends how complex site is.

hope this is helpful.
Copy linkTweet thisAlerts:
@gjerichFeb 14.2015 — sorry i forget end tag to close document in both cases with:
[code=php]</html>[/code]
Copy linkTweet thisAlerts:
@gjerichFeb 14.2015 — and [code=php]<bod>[/code] is [code=php]<body>[/code]
typo :mad:
Copy linkTweet thisAlerts:
@roddickauthorFeb 15.2015 — and [code=php]<bod>[/code] is [code=php]<body>[/code]
typo :mad:[/QUOTE]


Thank you very much for your reply. That helps me put things into context.
×

Success!

Help @roddick spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...