PHP Syntax

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
quadoc
Forum Contributor
Posts: 137
Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA

PHP Syntax

Post 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... :roll:

<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>
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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>
Last edited by Burrito on Sat Jul 09, 2005 5:08 pm, edited 1 time in total.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

You need to put a semicolon after your echoes. Also, please read Posting Code in the forums.

viewtopic.php?t=21171
User avatar
quadoc
Forum Contributor
Posts: 137
Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA

Post 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>
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Why did you remove the echo?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

see my edit 8O

and follow hawley's advice 8O 8O
User avatar
quadoc
Forum Contributor
Posts: 137
Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA

Post by quadoc »

I did see the terminate </td>

also, do I really need the "echo" ?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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; ?>
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

That is a programming preference...

Read the following:

http://www.dagbladet.no/development/php ... /#codetags
User avatar
quadoc
Forum Contributor
Posts: 137
Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA

Post by quadoc »

Thanks for the tips guys... :D
Post Reply