Jump to content


Photo

Making an .html page to a .php page


  • Please log in to reply
3 replies to this topic

#1 eddie barzoon

eddie barzoon
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 24 October 2006 - 08:56 PM

My professor wants us to make our html pages into php pages with the use of "include" in our code.

My web space consists of:

Main folder: /public_html

Three sub folders: personal, exercises, images

The main folder has index.php, styles1.shtml, header1.shtml, header2.shtml, footer1.shtml, footer2.shtml

The personal folder has another index.php

The exercises have class exercises in it

The images has image files in it

The files that he wants us to use in the includes are the styles, footers, and headers.  I don't have a problem using them on in the index code, it's just < ? php include("header1.shtml"); ? >

But the files I need to use these includes are in the exercises folder and not the main folder.  How do I write an include to use these?

#2 Psycho

Psycho
  • Moderators
  • Move along, nothing to see here
  • 11,892 posts
  • LocationCanada

Posted 24 October 2006 - 09:13 PM

It's just a path tot he files, just like a link in HTML:

< ? php include("exercises/header1.shtml"); ? >

The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net

#3 Cagecrawler

Cagecrawler
  • Members
  • PipPipPip
  • Advanced Member
  • 247 posts

Posted 24 October 2006 - 10:09 PM

Actually, to go from exercises to the main folder you'll want:
<?php include("../header1.shtml"); ?>

#4 Psycho

Psycho
  • Moderators
  • Move along, nothing to see here
  • 11,892 posts
  • LocationCanada

Posted 24 October 2006 - 10:36 PM

Ah, I misread that. Thanks for picking up my fumble.
The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users