Hi there!
I am making a web page, and I want the user to be able to decide which part of
the webpage ends up where, left or right side. So we have what I call "content"
and "sidebar". As in a text, you see the content to the left and the sidebar to
the right. This is done with something like this:
<table>
<tr>
<td>
## lots of php and html code to show the text and such
</td>
<td>
## lots of php and html code to contruct the sidebar ?>
</td>
</tr>
</table>
.... in a simplified manner. Now, the first chunk of php code is of course the
"content" and the second is the "sidebar".
Now, both the content and the sidebar consists of pure html and breaks into php
code, so it's not just php code. What I would like to do is read the two
different chunks of code into two seperate variable, much like, in pseudocode:
<? $content = "?>
<td>
## lots of php and html code to show the text and such
</td>
<? "; ?>
<? $sidebar = "?>
<td>
## lots of php and html code to contruct the sidebar ?>
</td>
<? "; ?>
And then just do a:
<table>
<tr>
$content
$sidebar
</tr>
</table>
Or reversed, depending on how the user wants to view it. It's fairly important
to me that I don't have to output all html via php (i.e. <? print "<font
size...>"; ?>)
Is there a way to do this with vanilla PHP ?
--
Sandman[.net]
I am making a web page, and I want the user to be able to decide which part of
the webpage ends up where, left or right side. So we have what I call "content"
and "sidebar". As in a text, you see the content to the left and the sidebar to
the right. This is done with something like this:
<table>
<tr>
<td>
## lots of php and html code to show the text and such
</td>
<td>
## lots of php and html code to contruct the sidebar ?>
</td>
</tr>
</table>
.... in a simplified manner. Now, the first chunk of php code is of course the
"content" and the second is the "sidebar".
Now, both the content and the sidebar consists of pure html and breaks into php
code, so it's not just php code. What I would like to do is read the two
different chunks of code into two seperate variable, much like, in pseudocode:
<? $content = "?>
<td>
## lots of php and html code to show the text and such
</td>
<? "; ?>
<? $sidebar = "?>
<td>
## lots of php and html code to contruct the sidebar ?>
</td>
<? "; ?>
And then just do a:
<table>
<tr>
$content
$sidebar
</tr>
</table>
Or reversed, depending on how the user wants to view it. It's fairly important
to me that I don't have to output all html via php (i.e. <? print "<font
size...>"; ?>)
Is there a way to do this with vanilla PHP ?
--
Sandman[.net]
Comment