Jump to content

Div To Hyperlink


arunpatal

Recommended Posts

Hi, Happy new to everyone :)

 

I want to hyperlink a div

 

It works like this

 

<div id="right_content"
onclick="document.location.href='list_topic.php?id=<?php echo $row_sub_cat['subid']; ?>';"
style="cursor:pointer;cursor:hand"> </div>

 

but

 

when i want to use it with if else statement like this

 

 

<?php
if (isset($row_sub_cat['subid'])){
echo
	 '<div id="right_content"
onclick="document.location.href='list_topic.php?id='.$row_sub_cat['subid'].'';"
style="cursor:pointer;cursor:hand"> </div>'; }

 else
 {
 echo '<div id="right_td_content_for_list">there is no subcategory</div>';
 }

 ?>

 

It don't work

 

Any Help ????

Link to comment
https://forums.phpfreaks.com/topic/272569-div-to-hyperlink/
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.