Previous Thread
Next Thread
Print Thread
Rate Thread
#247314 05/21/2003 2:28 PM
Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
I'm trying to include php in a forum's header:

<?
ech <<<echothis
Hello World...
echothis;
?>

When I load the header again after saving this it adds a space infront of <?, echothis; and ?> and causes the header to not display if I don't remove the space before saving again.

Is there a way to add php and have it not add spaces in the admin header editor?

I hope that makes sense.

Thanks.

Sponsored Links
romka #247315 05/21/2003 2:36 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I assume that "ech" is just a typo here, and that you used "echo" in the actual header.

What happens if you edit the header file manually, instead of using the admin page editor? If that doesn't solve the problem, could you put the header file into a .zip file, and attach it here?

Also mention which version you're using.

romka #247316 05/21/2003 2:36 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
You can try this:

<?php echo "something"; ?>

That works on my board.

-Fusion- #247317 05/21/2003 2:47 PM
Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
Don't you have to put code all on one line to keep it from putting in <br> and breaking the code. I'm pretty sure that is the rule for html.

BrokenToy #247318 05/21/2003 4:53 PM
Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
Okay more info:

Yes it was a typo.

This does not work as I expected (copied from a template):
Code
<br /><!-- <? //UBBTREMARK --><br /><!-- echo <<<UBBTPRINT --><br />Testing.<br /><!-- UBBTPRINT; --><br /><!-- /* UBBTREMARK */ ?> --><br />

But this does:
Code
<br /><?<br />echo <<<UBBTPRINT<br />Testing.<br />UBBTPRINT;<br />?><br />

It is saved without spaces form the admin header editor.

But when loaded back into the admin header edit it becomes (with spaces at front and it no longer works):
Code
<br /> <?<br /> echo <<<UBBTPRINT<br /> Testing.<br /> UBBTPRINT;<br /> ?><br />

Version 6.2

My alternative method is to include a seperate file for what is being echoed (and changed frequently) but I wanted to simplify it and keep all the header code in one file.

Sponsored Links
romka #247319 05/21/2003 5:06 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
If you put all php code on one line, it shouldn't break when editing again.
If you want to insert a larger php block, i'd prefer to include another file.

-Fusion- #247320 05/21/2003 7:43 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
You can also place this as the header file in the admin section and make a template to use for your header

<?

$html = new html;

// Grab the tablewrapper
list($tbopen,$tbclose) = $html -> table_wrapper();

// Send the template
include("$thispath/templates/$tempstyle/header.tmpl");

?>

sf49rminer #247321 05/21/2003 10:00 PM
Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
Yeah that's going to be my alternative...the stuff around it is not updated, but the template content is going to. Just would rather keep it in one place.

romka #247322 05/23/2003 3:11 AM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Well if the template is going to change often wite the header into a template. I have attached what a stock template is here for you for a header.
Attachments
81689-header.txt (0 Bytes, 24 downloads)


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
• Shock Hosting
• Stable Host
• bluehost
• InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,156
Joined: July 2001
Forum Statistics
Forums63
Topics37,583
Posts293,957
Members13,826
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 2063
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 1
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20261026)