Web Hosting Talk







View Full Version : Include php not working?


crspyjohn
03-29-2006, 04:12 AM
if ($id == "") { include "main.htm"; } else { include
"$id.htm"; }

I found my old website i had awhile back and was looking at the include script. Can anyone help me out on why it isn't working?

<< link removed >>

crspyjohn
03-29-2006, 04:18 AM
nvm i sloved it was a error on my side

writespeak
03-29-2006, 05:11 AM
Moved to Programming.

Glad to hear you solved the problem. :)

Lois

dabluedude
03-30-2006, 10:20 AM
-delete please-

dabluedude
03-30-2006, 10:22 AM
good thing it works now, I'd recommand using global vars though:

if ($_GET['id'] == '') { include 'main.htm'; } else { include
$_GET['id'].'.htm'; }

anjanesh
03-30-2006, 03:55 PM
Thought include was a function - should be used like this - include("main.htm");.
include 'main.htm'; in php ?

godong
03-30-2006, 05:41 PM
anjanesh: Both works, though using () is a good practice.