Forum Moderators: coopster

Message Too Old, No Replies

Link mouseover

Is it possible in php?

         

ajs83

7:43 am on Dec 27, 2004 (gmt 0)

10+ Year Member



Is it possible to use a link mouseover in php?

dreamcatcher

9:23 am on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you mean a tooltip?

echo '<a href="link.htm" title="This Link">';

If you mean javascript mouseover effects, then no. PHP cannot perform any client side operations.

ajs83

10:05 am on Dec 28, 2004 (gmt 0)

10+ Year Member



I mean when some one hovers over the link, the destination is not shown in the status bar.

davelms

10:25 am on Dec 28, 2004 (gmt 0)

10+ Year Member



As dreamcatcher wrote you *can*, but it's not PHP that does it. This is a client-side or javascript question. Something like might do what you want, within the A tag itself... it might not work in all browsers:


onMouseOver='window.status="Some alternative text here"; return true' onMouseOut='window.status="Done"; return true'

ajs83

8:26 pm on Dec 28, 2004 (gmt 0)

10+ Year Member



Here is the code im trying to use

echo "<tr height=28><td height=15 bordercolor=lightgrey bgcolor=lightgrey><table width=100%><tr><td align=left><b>$points</b> Points</td><td align=right><a onmouseover="window.status='Complete';return true onmouseout="window.status=' ';return true;" href=\"$url$sid\" target=_blank>Complete</A>";

But when I try top call up the page I get a

"Parse error: parse error, unexpected T_STRING, expecting ',' or ';'

Salsa

9:24 pm on Dec 28, 2004 (gmt 0)

10+ Year Member



You just need to escape all of the double quotes in the string, and I think you'll be okay.

ajs83

9:33 pm on Dec 28, 2004 (gmt 0)

10+ Year Member



I'm just beginning to work with php, what is the acceptable alternative to the double quotes?

Salsa

10:05 pm on Dec 28, 2004 (gmt 0)

10+ Year Member



Just put backslashes in front of them as you did with
href=\"$url$sid\"
. As it is, you're getting the error because PHP thinks you want to echo out only up to...
"window.status
...because it thinks you mean to close the quotes there. To tell PHP that you mean to use a litereal double quote there, escape the quote with a backslash:
\"