Jump to content

[SOLVED] Title = ***


Gubbins

Recommended Posts

Hello,

I am sure this one is so easy that i am looking to deep.

 

Here is my php

<? while ($fams = mysql_fetch_assoc($fam)){
$name = $fams['name'];
$loc = $fams['location'];

$name = "<a href=\"famprofile.php?name=".$name."\">".$name."</a>";
?>

 

Other code that doesnt work

<center><img src=images/worldmap/l8p1.jpg><img src=images/worldmap/l8p2.jpg><title=?php echo ($loc)($name); ?>

 

When the mouse is hovered over the pic i would like to display the location and name.

Does anyone know where i am going wrong please?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/131544-solved-title/
Share on other sites

First, always use <?php and not <?

 

<?php
while ($fams = mysql_fetch_assoc($fam)) {
  $name = $fams['name'];
  $loc = $fams['location'];

  $name = '<a href="famprofile.php?name='.$name.'">'.$name.'</a>';
?>

I've not changed much so can't see why it wasn't working - would be handy to say what it isn't doing what you want it to do instead of saying "it doesn't work"

 

<center><img src="images/worldmap/l8p1.jpg"><img src="images/worldmap/l8p2.jpg"><title=<?=$loc.$name?>

 

Again, no idea what you're trying to do here, can you explain a little better?

 

Link to comment
https://forums.phpfreaks.com/topic/131544-solved-title/#findComment-683202
Share on other sites

first, always open php with a <?Php tag

also do this

 

title="<?Php echo $loc.$name; ?>"

or if you want a space inbetween the two

 

title="<?Php echo $loc.' '.$name; ?>"

 

try that

 

Thank you, The mouse over now works in firefox but in I.E. (it distorts the picture) as there is 2 pics next to each other and the one on the right is the one i would like the title to show!

Any Ideas?

Link to comment
https://forums.phpfreaks.com/topic/131544-solved-title/#findComment-683216
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.