include files

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
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

include files

Post by C_Calav »

hi guys,

just been at tech and we are doing a project in asp, (HAVE to do a project in asp, crappy i know) and im in a small team. now the lady wrote some code today and she used a include file menu.inc for the menu. now this menu was generic across all pages. it was a good idea as it was helpful for my webpage. so i did a bit of googling and it seems its only for asp? is this correct?

all i want to do is put my nav in a include file and include it on my html/php pages.

can i do this and what is the include file code for this.

i have used include files in php (connection file etc) but not for html for example a menu.

thanx!
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

Post by harsha »

use any asp2php convertor and convert the asp code to php
or include it remotely.

include_once("http://www.somesite.com/nav.asp");
and do some manipulations

enable ASP tags <% %> Tags in php.ini and try it
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

also make sure that the webserver you are using can interpret asp pages otherwise there is not poing in doing the second suggestion.

if the asp file is just providing the menu structure then it will be fine to use as long as the links are correct for your php pages.
I find that when redirecting from asp to php pages or vice versa that the GET method is best. IMHO.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You can include HTML just as easily as a connection file:

Code: Select all

include 'mymenu.inc.php';
Mac
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post by C_Calav »

thanx guys for your replys!

ill try some of those methods out tomorow.

my website i want to use the include files for is at home and it is done all in php.

sorry if anyone got confussed.. or if i am.

but why would i need asp tags in my php code for include files?

cheers!
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

from my bookmarks:

http://asp2php.naken.cc/

:)
Post Reply