public function buildHeader(){
$output = '<title>' . $this->title . '</title>' . "\n" .
(include 'styleLinks.php') . "\n" .
'</head>' . "\n" .
'<body>' . "\n" .
'<div id="pageStyle">' . "\n" .
'<div style="width: 1024px; height: 160px;">' . "\n" .
'<img src="images/natoFlag.jpg" class="headerImage headerImageAlignment"/>' . "\n" .
'<img src="images/banner.jpg" class="headerImageAlignment" style="width: 740px; height: 140px; border-radius:
15px; -moz-border-radius: 15px; -webkit-border-radius: 15px;
-khtml-border-radius: 15px;"/>' . "\n" .
'<img src="images/napoleonFlag.jpg" class="headerImage headerImageAlignment"/>' . "\n" .
'</div>' . "\n";
return $output;
}
4 replies to this topic
#1
Posted 12 June 2011 - 04:07 AM
Hi. Could anyone tell me what makes this function always print "1" at the top of the screen?
|
|
|
#2
Posted 12 June 2011 - 04:18 AM
You include statement likely returns a value of some sort, and evaluates to 1 somewhere in your code. Try to take this include statement out of your variable and treat it separately.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 12 June 2011 - 05:45 AM
It's hard to imagine how to do that. I need to use include to load the html code from another file
#4
Posted 12 June 2011 - 04:18 PM
include was not meant to be used for that, if there is any non-text code (PHP) then it will be written before it is placed in output. It is like saying this:
It would simply echo foo regardless of you instructing it to be stored in $variable.
You would need to look at an option such as file_get_contents() of which parses the PHP and returns a plaintext which can be safely wrapped in a string.
$variable = (echo "foo" . "some other stuff");
It would simply echo foo regardless of you instructing it to be stored in $variable.
You would need to look at an option such as file_get_contents() of which parses the PHP and returns a plaintext which can be safely wrapped in a string.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#5
Posted 24 June 2011 - 04:21 AM
thanks alot, Alexander. file_get_contents() helped to solve that problem
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









