Naveed Cheema Naveed Cheema - 1 year ago 60
PHP Question

how to set value using php inside <a></a> tag

Basically, I'm trying to set the title against the value which came from DB but when I make a PHP statement in inverted commas to set title the tag got disturbed. Any Suggestions ??

echo ?>
<td><a id="bookmark-this" value= "hi" href="#" title="<?php $Institute_Code ?>" >Bookmark This Page</a><td>

Answer Source

You aren't printing the $Institute_Code variable

You have...

 title="<?php $Institute_Code ?>"

You need to use one of these methods

     title="<?php echo $Institute_Code; ?>"



Also, the other echo ?> will cause an error, make that just ?>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download