Jump to content

show the value of a image HTML


raman

Recommended Posts

I want to show in HTML page what a particular image stands for by making that yellow box appear when mouse is pointed on that.Can someone tell how to do this ?I have already tried the alt attribute for the image but it does not work out,rather creates more problems.

One of the example pages is :

http://www.ncbs.res.in/index.php?option=com_content&task=view&id=349&Itemid=330

 

When you point on those three images on the right you can see their values "PDF" , "E-mail" etc.

Link to comment
https://forums.phpfreaks.com/topic/131061-show-the-value-of-a-image-html/
Share on other sites

No this is only a hyperlink.

What I talked about I get with the attribute title.However I get an error,that is - instead of taking the value from the excel variable it goes into the second part of the loop,the else part.

This is my code where I use the title attribute:

echo"<p>The total number of records retrieved by your query is $counter.</p><input type='image' src='Excel.gif' name='excel' title='Download selected items as excel file.' /><input type='image' src='text.jpg' name='fasta' title='Download as fasta file' />";

 

And this is where I get the input from it:

<?php
$kyu=$_POST['pro'];
$exc=$_POST['excel'];
$fas=$_POST['fasta'];

$conn= mysql_connect("localhost.localdomain","root","pichii13");
if(!$conn)
  {
    die('Could not connect:'.mysql_error());
  }
mysql_select_db("Protvirdb",$conn);
if(empty($exc))
  {
    $file='fastafile.fasta';$type="plain/text";
    ob_start();
    //   echo"<p>";
    foreach($_POST['pro'] as $kyu){
      $re=mysql_query("SELECT * FROM fasta WHERE SNo='$kyu'");
      while($row=mysql_fetch_array($re))
{
  echo"".$row['header']."";echo"\n";echo"".$row['Sequence']."";echo"\n";
}
    }
  }else{
  $type="application/vnd.ms-excel;charset:UTF-8";
  $file = 'ExcelFile.xls';
  // start buffring
  ob_start();
  // sample dynamically generated data
  echo '<table border="1"> ';
  echo '<tr><th>Category</th><th>Protein</th><th>Brief Description</th></tr>';
  foreach($_POST['pro'] as $kyu){
    $re=mysql_query("SELECT * FROM cryptovir WHERE SNo='$kyu'");
    while($row=mysql_fetch_array($re))
      {
echo"<tr>";
echo"<td>".$row['Category']."</td>";
echo"<td>".$row['Name']."</td>";
echo"<td>".$row['Brief_Description']."</td>";
echo "</tr>";
    
      }
  }
}

  mysql_close($conn);

  $content = ob_get_contents();
  ob_end_clean();

header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

header("Pragma: no-cache");
header("Content-type:$type;charset:UTF-8");
header('Content-length: '.strlen($content));
header('Content-disposition: attachment; filename='.basename($file));//

  // output all contents
  echo $content;

  exit; // If any tags/things not supported by excel will output then it will try to //open in office word
  
?>

 

 

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.