Printing to a area tag

Instead of writing the code to print in a special area I would like to template it so I print to a #error place or such how do I do this.

Please provide MORE Detail… Perhaps an example. the more info you give us the more we can help you. Your questions seem to be very vague. Vague questions get vague answers.

Well like the website Gaiaonline or Myspace they have things like #aboutme and #media instead of having to look at the code and change it from there. They instead do things like this #aboutme info here then #media info here.

When using the #ID (substitute whatever name in for ID that’s appropriate) that is HTML that will go to a specific part of the current document. Typically if you have a LONG page and you want users to be able to SKIP sections (such as a single page with a TOC at top and content below) you can create an ID in the code at that location and then in your TOC have an anchor to #ID and it will jump to that location in the page.

This is not PHP so much as it’s html.

I’m not familiar with Gaiaonline or Myspace but I think what you mean is using #var as a placeholder for actual content. Yes, that’s possible with DHTML/Javascript, but pre-processing is also possible if you use str_replace() before actually outputting it:

$var = "MyName";
$template = "<b>#var</b>";
$output = str_replace("#var", $var, $template);
echo $output; // Displays <b>MyName</b>
Sponsor our Newsletter | Privacy Policy | Terms of Service