Whats the difference?

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
nadeem14375
Forum Newbie
Posts: 23
Joined: Sat Oct 30, 2010 2:11 am

Whats the difference?

Post by nadeem14375 »

Dear all,

I am new to PHP.

here are 2 codes:

1. index.html
<body>
<?php
include("menu.php");
?>
<h1> Welcome to my page! </h1>
</body>

2. index.php
<body>
<?php
include("menu.php");
?>
<h1> Welcome to my page! </h1>
</body>

here is the menu.php

<html>
<body>
<a href="/mypage/index.html">Home</a>
<a href="/mypage/tutorials.php">Tutorials</a>
<a href="/mypage/references.php">References</a>
<a href="/mypage/examples.php">Examples</a>
<a href="/mypage/about.php">About Us</a>
<a href="/mypage/contact.php">Contact Us</a>

</body>
</html>

the index.php show the home , tutorials, references, examples, about and contacts us links when executed but the index.html don't show.

What's the difference in both and what the problem in index.html.

Regards:

Muhammad Nadeem
User avatar
amirbwb
Forum Commoner
Posts: 89
Joined: Sat Oct 30, 2010 6:10 pm

Re: Whats the difference?

Post by amirbwb »

muhammad HTML files don't accept php code:
so <?php ?> this code is not accepted by html files.
USE THIS ONLY IN PHP FILES.

////////////////////////////////
If your are making template ... create it in xhtml and than use PHP to make your website dynamic...

NSHALLAH TKOUN FHEMET =D
nadeem14375
Forum Newbie
Posts: 23
Joined: Sat Oct 30, 2010 2:11 am

Re: Whats the difference?

Post by nadeem14375 »

Dear amir bawab,

Thanks for your reply.

can you send me a sample of xhtml, or guide to a tutorial?

Regards:

Muhammad nadeem
User avatar
amirbwb
Forum Commoner
Posts: 89
Joined: Sat Oct 30, 2010 6:10 pm

Re: Whats the difference?

Post by amirbwb »

http://websitetips.com/articles/xhtml/basics/
http://net.tutsplus.com/

And try googling "a sample of xhtml" or "xhtml tutorial"...
Post Reply