Which code is right?
<?php include ("ID"); ?>
<?include ("ID"); ?>
<?php include ("ID");?>
<?include ("ID");?>
or are they all wrong? people have said that <?include ("ID"); ?> was right but it doesn't work on my site! and when you link to a file, would it be like:
<a href=http://www.htmlforums.com/archive/index.php/"index.php?ID=home.html" target="_PARENT" name="Home" onmouseover="window.status='Home'; return true;" onmouseout="window.status=''; return true;" title="Home" accesskey="H">Home</a>
Thank You,
Kevin NaiaThe PHP include might only work with actual files.
Example, here is one of my includes...
<? include ("header.php"); ?>
That finds the file and puts the coding contents of the file into that spot.depends on how your PHP is set up. most of the time, using "<?" is fine; you probably don't have to actually put the "php" bit in there.
<?
if (isset($ID)) {
include("$ID");
} else {
include("something.php");
}
?><a href=http://www.htmlforums.com/archive/index.php/"?ID=home.html">Home</a>
should work.the reason it wasn't working was probably because you didn't have "ID" as a variable. in other words, you didn't have the "$" in front of its name, e.g., "$ID".Thank You!
<?php include ("ID"); ?>
<?include ("ID"); ?>
<?php include ("ID");?>
<?include ("ID");?>
or are they all wrong? people have said that <?include ("ID"); ?> was right but it doesn't work on my site! and when you link to a file, would it be like:
<a href=http://www.htmlforums.com/archive/index.php/"index.php?ID=home.html" target="_PARENT" name="Home" onmouseover="window.status='Home'; return true;" onmouseout="window.status=''; return true;" title="Home" accesskey="H">Home</a>
Thank You,
Kevin NaiaThe PHP include might only work with actual files.
Example, here is one of my includes...
<? include ("header.php"); ?>
That finds the file and puts the coding contents of the file into that spot.depends on how your PHP is set up. most of the time, using "<?" is fine; you probably don't have to actually put the "php" bit in there.
<?
if (isset($ID)) {
include("$ID");
} else {
include("something.php");
}
?><a href=http://www.htmlforums.com/archive/index.php/"?ID=home.html">Home</a>
should work.the reason it wasn't working was probably because you didn't have "ID" as a variable. in other words, you didn't have the "$" in front of its name, e.g., "$ID".Thank You!