Page 1 of 1
PHP Syntax
Posted: Sat Jul 09, 2005 5:00 pm
by quadoc
I can't seem to get the following statement to work. Could someone see if anything is wrong with it and post some tips. Thanks...
<td bgcolor="<? echo $cellcolor; ?><a href="?x=admin&a=read&mess=<? echo $messid;?> class="link" onMouseover="showtip(this,event,'<?=$message_1?>')" onMouseout="hidetip()"><?=substr($message_2,0,25)?></a></td>
Posted: Sat Jul 09, 2005 5:07 pm
by Burrito
what about it isn't working?
we need more details to help you...
also in your href it's always good practice to include the page to which you're sending the client...even if it's "self".
edit: after looking again, I see a potential problem.
you're not terminating your <td>
Posted: Sat Jul 09, 2005 5:07 pm
by hawleyjr
You need to put a semicolon after your echoes. Also, please read Posting Code in the forums.
viewtopic.php?t=21171
Posted: Sat Jul 09, 2005 5:15 pm
by quadoc
Ok, I removed the echo and still not working. I'm trying to create a link with the message displaying.
<td bgcolor="<?=$cellcolor ?><a href="?x=admin&a=read&mess=<?=$messid?> class="link" onMouseover="showtip(this,event,'<?=$message_1?>')" onMouseout="hidetip()"><?=substr($message_2,0,25)?></a></td>
Posted: Sat Jul 09, 2005 5:16 pm
by hawleyjr
Why did you remove the echo?
Posted: Sat Jul 09, 2005 5:16 pm
by Burrito
see my edit
and follow hawley's advice

Posted: Sat Jul 09, 2005 5:19 pm
by quadoc
I did see the terminate </td>
also, do I really need the "echo" ?
Posted: Sat Jul 09, 2005 5:21 pm
by Burrito
but you didn't terminate the <td>...
you need:
Code: Select all
<td bgcolor="<? echo $cellcolor; ?>">
instead of
Code: Select all
<td bgcolor="<? echo $cellcolor; ?>
mp;quote;>
instead of
Code: Select all
<td bgcolor="<? echo $cellcolor; ?>
<td bgcolor="<? echo $cellcolor; ?>">
instead of
Code: Select all
<td bgcolor="<? echo $cellcolor; ?>
Posted: Sat Jul 09, 2005 5:21 pm
by hawleyjr
That is a programming preference...
Read the following:
http://www.dagbladet.no/development/php ... /#codetags
Posted: Sat Jul 09, 2005 6:01 pm
by quadoc
Thanks for the tips guys...
