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
quadoc
Forum Contributor
Posts: 137 Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA
Post
by quadoc » Fri Aug 19, 2005 8:57 am
I've the following code that suppose to have a link and display the tooltip when user hover the mouse over it, but I keep getting error message. Could someone tells me what I did wrong and post some tips. Thanks...
Code: Select all
'<td bgcolor="'.$cellcolor.'"><a href="?x=read&id='.$id.'" class="link">'.$subject.' onMouseover="showtip(this,event,'<?=$desc_1?>')"'.' onMouseout="hidetip()"><?=substr($subject,0,30)?>'</a></td>';
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Aug 19, 2005 9:03 am
Code: Select all
echo '<td bgcolor="'.$cellcolor.'"><a href="?x=read&id='.$id.'" class="link" '.$subject.' onMouseover="showtip(this,event,'.$desc_1.')" onMouseout="hidetip()">'.substr($subject,0,30).'</a></td>';
not quite sure what you are doing with $subject in the middle of the link code though..
raghavan20
DevNet Resident
Posts: 1451 Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:
Post
by raghavan20 » Fri Aug 19, 2005 9:05 am
Code: Select all
onMouseover="showtip(this,event,'.$desc_1.')" //notice the comma after this
think should be
Code: Select all
onMouseover="showtip(this.event,'.$desc_1.')"
your quotes were so confusing
quadoc
Forum Contributor
Posts: 137 Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA
Post
by quadoc » Fri Aug 19, 2005 9:31 am
Thanks for the tips guys. Is there a PHP Syntax checker utility out there that I can use? Thanks...
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Aug 19, 2005 9:35 am
php
seriously.. who would better do syntax checking than the language itself?
quadoc
Forum Contributor
Posts: 137 Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA
Post
by quadoc » Fri Aug 19, 2005 9:43 am
no, what I meant is, is there a PHP Syntax Checker editor. PHP doesn't tell me the error until you run the script.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Aug 19, 2005 9:48 am
you can line the script:
Code: Select all
[feyd@home]> php -l script.php
PHP Parse error: syntax error, unexpected T_ECHO in script.php on line 4
Parse error: syntax error, unexpected T_ECHO in script.php on line 4
Errors parsing script.php
[feyd@home]> _