Jump to content

adding alt and title tag


sandbudd

Recommended Posts

Hey guys I am trying to add title tags to a link... something like title="$something then more information"; but can't get it to work.  Here is the working code without the title attribute.  Any help would be great

 

<?php
if(empty($row_Recordset1['fb'])){
   //empty() returned true : so there is nothing
   echo 'FB';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
   echo '<a href="javascript://" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb']  . '\');" class="style3">FB</a>';
}
?>

Link to comment
https://forums.phpfreaks.com/topic/244535-adding-alt-and-title-tag/
Share on other sites

Okay this works and displays correctly the next question is I want to add onto the title statement with some copy example $row_Recordset1['high_school'] then add something else....

 

Here is the code that works so far

 

<?php

if(empty($row_Recordset1['fb'])){
   //empty() returned true : so there is nothing
   echo 'FB';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
   echo '<a href="javascript://" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb']  . '\'" title="' . $row_Recordset1['high_school'] . '");" class="style3" >FB</a>';

}
?>

Never mind I got it...long day

 


<?php

if(empty($row_Recordset1['fb'])){
   //empty() returned true : so there is nothing
   echo 'FB';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
   echo '<a href="javascript://" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb']  . '\'" title="' . $row_Recordset1['high_school'] . 'whats up");" class="style3" >FB</a>';

}
?>

will thought I had it but now the popup function does not work argh...

 


<?php

if(empty($row_Recordset1['fb'])){
   //empty() returned true : so there is nothing
   echo 'FB';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
   echo '<a href="javascript://" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb']  . '\'" title="' . $row_Recordset1['high_school'] . ' Football Schedule");" class="style3" >FB</a>';

}
?>

just had to swap them around this works and thanks again for the help

 

  <?php

if(empty($row_Recordset1['fb'])){
   //empty() returned true : so there is nothing
   echo 'FB';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
   echo '<a href="javascript://" " title="' . $row_Recordset1['high_school'] . ' Football Schedule" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb']  . '\');" class="style3" >FB</a>';

}

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.