[SOLVED] Include function

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
Epiphany
Forum Newbie
Posts: 5
Joined: Sun Jun 13, 2004 4:52 pm
Contact:

Include function

Post by Epiphany »

I followed enygma's tutorial exactly on how to do the include.
I even looked at coding from another site to make sure I had the formatting right.
I'm certain I did but it will not should the page I put in...

I tried using
<?include("left.php");?>

That didn't work, and I tried using
<?php
include ("NewMenu.php");
?>

and that didn't work either. Can anybody help me shed some light on my problem?

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

<?php
phpinfo();
?>
does that work?
Epiphany
Forum Newbie
Posts: 5
Joined: Sun Jun 13, 2004 4:52 pm
Contact:

Post by Epiphany »

Nopers, just tried and the same problem as before. Nothing appears.
If I put letters in where I would put the include or that phpinfo one you suggested, the letters appear when I open the page in IE...
When I put the include or phpinfo, the page I tried to include doesn't show up. Athe other page is is "Testing" in bold red letters...
The "Testing" page works when I open it up in IE...
Dash
Forum Newbie
Posts: 5
Joined: Sun Jun 13, 2004 5:27 pm

Post by Dash »

Is your page's extension .php? Are you sure you can make php pages on your server? Did you upload your page before checking if the include worked?

If you did all this and you only need an include, you could try using an SSI. (.shtml files)
Epiphany
Forum Newbie
Posts: 5
Joined: Sun Jun 13, 2004 4:52 pm
Contact:

Post by Epiphany »

The extensions are PHP. My server can't use PHP which is why I'm not uploading it yet. Merely seeing if it works when I try and view it from the harddrive.
I've thought about using SSI...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

are you sure you installed php correctly, and mapped the proper mimetypes for php to execute them?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

view it from the harddrive
Just wondering, you arn't doing File->Open are you, you are accessing it via http://localhost/foo.php (or whatever it's called) ?
Yonderknight
Forum Commoner
Posts: 31
Joined: Sun Jun 13, 2004 6:51 pm

Post by Yonderknight »

You need to install a PHP server on your compute, you can't just try to test them by opening them.
Use http://www.easyPHP.org
User avatar
snpo123
Forum Commoner
Posts: 77
Joined: Sat Apr 17, 2004 6:31 pm

Post by snpo123 »

Try viewing the source of your php pages. If your php script shows up in the html, that means that php isnt installed on your computer. You have to install apache and configure it with php. that way you'll be able to test your scripts on your local machine. If you need help doing that go to the apache section of devnetwork.
Epiphany
Forum Newbie
Posts: 5
Joined: Sun Jun 13, 2004 4:52 pm
Contact:

Post by Epiphany »

Oh, so I probably have it correct in on my comp. I just need to find a server (ie: i'm too lazy to install in on my comp) that supports PHP?

LoL, I feel dumb. Thanks for the help.
Happen to know of any free hosts that support PHP?

Thanks in advance.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Not really, but I have an easy to follow guide on how to turn your machine into your own free webhost..

http://lps.no-ip.org/install.php

tell me if it helps :)
Epiphany
Forum Newbie
Posts: 5
Joined: Sun Jun 13, 2004 4:52 pm
Contact:

Post by Epiphany »

Problem solved. Thanks guys.
Post Reply