/    Sign up×
Community /Pin to ProfileBookmark

Hi, i am thinkin of make a website in php but this will not be for a bit becasuse i know no php. But when i do can you use html and php all in one site. The php bit would just be so that i could put all the info could go on the server and not all on the site. If you can understand that. Html for the txt and layout?

Thanks?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@DJsACOct 16.2004 — In order to be able to use php you'll need a website, usually written in HTML.

PHP is a server side language which does certain actions for you. Mathematical calculations, select values from a database, 'register' users or IP addresses, etc...

The PHP is implemented into a site, but the 'viewable' part of the site is still built using HTML code.

for example

index.html
[CODE]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>IN HTML</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>

<body>
<table width="574" border="2" cellspacing="0" cellpadding="2">
<tr>
<td width=20%><a href="index.html" target="_self">link</a></td>
<td width=20%><img src="image.jpg" alt="image" width=100% height="100"></td>
<td width=20%>&nbsp;</td>
<td width=20%>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#FFFF00"><span class="style1">Blah!</span></td>
<td>&nbsp;</td>
<td><strong>Blah!</strong></td>
<td>&nbsp;</td>
</tr>
</table>
<span class="style1"></span>
</body>
</html>
[/CODE]

Would give the same result as:

index.php
[code=php]<?php
print('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>IN HTML</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>

<body>
<table width="574" border="2" cellspacing="0" cellpadding="0">
<tr>
<td width=20%><a href="index.php" target="_self">link</a></td>
<td width=20%><img src="image.jpg" alt="image" width=100% height="100"></td>
<td width=20%>&nbsp;</td>
<td width=20%>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#FFFF00"><span class="style1">Blah!</span></td>
<td>&nbsp;</td>
<td><strong>Blah!</strong></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<span class="style1"></span>
</body>
</html>');
?>
[/code]

The php code here is of NO use at all, but shows that php still uses normal html formatting to create the page's layout.
Copy linkTweet thisAlerts:
@ChrisyauthorOct 17.2004 — Thank you, i knew that you could do a we site in html or php but i didn't know you could do it in both at the same time.
Copy linkTweet thisAlerts:
@ChrisyauthorOct 17.2004 — can somone tell me a good place or book to get good at php
Copy linkTweet thisAlerts:
@JupacOct 17.2004 — YOu dont have to do that


[code=php]
<?php
//anything php
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>IN HTML</title>
<?php
//anything php
?>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>
<span class="style1">
<?php
//anything php
?>

</span>
</body>
</html>


[/code]
Copy linkTweet thisAlerts:
@Paul_JrOct 18.2004 — [i]Originally posted by Chrisy [/i]

[B]Thank you, i knew that you could do a we site in html or php but i didn't know you could do it in both at the same time. [/B][/QUOTE]

You can't build a website with just PHP. You must have HTML -- always. PHP is more of a way to manipulate the HTML into doing things that are otherwise impossible. HTML is still required, since that's how you build website.
×

Success!

Help @Chrisy 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...