Jump to content

[SOLVED] PHP & wz_tooltip


pwnuspoints

Recommended Posts

Hello again PHP freaks!

 

I'm sure you're all familliar with wz_tooltip. It's a simple javascript library which allows for a small pop-up to appear beside your cursor when you hover over a specified link.

 

I've used wz_tooltip before on a few really simple sites. However, now I'm looking to implement it on a larger scale in conjunction with PHP.

 

My goal is to have a tooltip pop up beside links which are dynamically generated using PHP/mySQL.

 

However, a problem arises with quotes and syntax. I wonder if someone would help me.

 

A typical tooltip link is coded as follows:

 

<a href="example.php" onmouseover="Tip('example')" onmouseout="UnTip()"><img src="example.jpg" width="88" height="53" border="0" alt="example" /></a>

 

Whatever you put inside the "Tip('here')" function will display in a pop up beside your cursor.

 

However, I seem to run in to trouble when I use this inside of a  mysql_fetch_array because of the quotes and double quotes.

 

I can get it partially working when I convert the above code as follows:

 

 

echo "<a href='example.php' onmouseover=Tip('$examplevar') onmouseout='UnTip()'><img src='images/"."$picutre".".gif' width='10' height='19' alt='example' border='0' /></a>";

 

 

The resulting tooltip only works when the $examplevar contains only alphabetic characters. Punctuation, numbers, and other characters result in a dead tooltip which doesn't even appear.

 

What can I do to get around this? Can I do anything? Thank you so much for your help!

Link to comment
https://forums.phpfreaks.com/topic/133528-solved-php-wz_tooltip/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.