Page 1 of 1

putting php code inside of $output =""

Posted: Tue Aug 10, 2004 10:33 am
by pinehead18

Code: Select all

<?php

<table class="table2">
 <tr>
 <td><font face=arial size=-1>» <b><a href=index.php>Forum</a> » <ahref=viewforum.phpf=".$fid.">".$forum_name."</a> »".$subject."</font></b>
</tr></td>
</table>
<br><br>
<table border=0 cellpadding=0 cellspacing=0 width=90%>
                <tr><td><a href=post.php?tid=$tid>Post Reply</a> - <a href=newthread.php?f=".$_GET['fid'].">New Topic</a></tr>
                <tr><td>&nbsp;</td></tr>
        </table>
                <table border=0 cellpadding=0 cellspacing=0 width=90% bgcolor=#CDCDCD>
                        <tr>
                         <td align=left width=20%>User</td><td align=left width=80%>Message</td>
                        </tr>
                </table>
<table class="table2">
".
                       $row = 25;
                        $x = 1;
                         $style = $style == '#CDCDCD' ? '#EEEEEE' : '#CDCDCD';
                        while ($x <= $row) {
.$topic_table.$dis.  
$x++;
        }
."

</table>
<table border=0 cellpadding=0 cellspacing=0 width=90%>
        <tr><td>&nbsp;</td></tr>
        <tr><td><a href=post.php?tid=$tid>Post Reply</a> - <a href=/newthread.php>New Topic</a></tr>
</table>";

?>
I'm error out where the php code starts and ". takes over.

Thank you for any help you can provid.e

Anthony

The code is sloppy cusae it came strait from securecrt i havn't converted to a editor yet. Next on my list of things to do.

Posted: Tue Aug 10, 2004 11:58 am
by John Cartwright
I duno is this would make a difference but on line 1

Code: Select all

<table class="table2">
should be

Code: Select all

<table class="table2">

btw... I don't understand what you said about the error.. explain please?

Posted: Tue Aug 10, 2004 12:18 pm
by pinehead18

Code: Select all

<?php
$output = "
        
        
<table class="table2">
 <tr><td><font face=arial size=-1>» <b><a href=index.php>KC Christians Forum</a> » <a
href=viewforum.php?f=".$fid.">".$forum_name."</a> »
".$subject."</font></b></tr></td>
</table>        
<br><br> 
<table border=0 cellpadding=0 cellspacing=0 width=90%>
                <tr><td><a href=post.php?tid=$tid>Post Reply</a> - <a href=newthread.php?f=".$_GET['fid'].">New Topic</a></tr>
                <tr><td>&nbsp;</td></tr>
        </table>
                <table border=0 cellpadding=0 cellspacing=0 width=90% bgcolor=#CDCDCD>
                        <tr>
                         <td align=left width=20%>User</td><td align=left width=80%>Message</td>
                        </tr>
                </table>
<table class="table2">
".
                       $row = 25;
                        $x = 1;
                         $style = $style == '#CDCDCD' ? '#EEEEEE' : '#CDCDCD';
                        while ($x <= $row) {
.$topic_table.$dis.
$x++;
        }
."

</table>
<table border=0 cellpadding=0 cellspacing=0 width=90%>
        <tr><td>&nbsp;</td></tr>
        <tr><td><a href=post.php?tid=$tid>Post Reply</a> - <a href=/newthread.php>New Topic</a></tr>
</table>";
?>
That is still cuasing me an error.
Parse error: parse error, unexpected '.'

Code: Select all

<?php
".
                       $row = 25;
                        $x = 1;
                         $style = $style == '#CDCDCD' ? '#EEEEEE' : '#CDCDCD';
                        while ($x <= $row) {
.$topic_table.$dis.
$x++;
        }
."
?>
That is where it error's out.

Thank you
Anthony

Posted: Tue Aug 10, 2004 12:25 pm
by Meteo
you dont have any semicolons where you need them to be

Code: Select all

<?php 
$output = " 
        
        
<table class="table2"> 
<tr><td><font face=arial size=-1>» <b><a href=index.php>KC Christians Forum</a> » <a 
href=viewforum.php?f=".$fid.">".$forum_name."</a> » 
".$subject."</font></b></tr></td> 
</table>        
<br><br> 
<table border=0 cellpadding=0 cellspacing=0 width=90%> 
                <tr><td><a href=post.php?tid=$tid>Post Reply</a> - <a href=newthread.php?f=".$_GET['fid'].">New Topic</a></tr> 
                <tr><td> </td></tr> 
        </table> 
                <table border=0 cellpadding=0 cellspacing=0 width=90% bgcolor=#CDCDCD> 
                        <tr> 
                         <td align=left width=20%>User</td><td align=left width=80%>Message</td> 
                        </tr> 
                </table> 
<table class="table2"> 
"; 
                       $row = 25; 
                        $x = 1; 
                         $style = $style == '#CDCDCD' ? '#EEEEEE' : '#CDCDCD'; 
                        while ($x <= $row) { 
$output .= $topic_table.$dis; 
$x++; 
        }
 
$output .= " 

</table> 
<table border=0 cellpadding=0 cellspacing=0 width=90%> 
        <tr><td> </td></tr> 
        <tr><td><a href=post.php?tid=$tid>Post Reply</a> - <a href=/newthread.php>New Topic</a></tr> 
</table>"; 
?>
try this, hopefully it may work.

edit - sorry i had to change something in that while loop, it might be better now.