Jump to content

link or not link


mrbitsinfo

Recommended Posts

good day to all

if have a code like this

    <ul>

        <li><a href="downloads/<?php echo $row_detail['des1']; ?>"><?php echo $row_detailis['download1']; ?></a></li>

        <li><a href="downloads/<?php echo $row_detail['des2']; ?>"><?php echo $row_details['download2']; ?></a></li>

    </ul></td>

    <td><div align="center">

 

as u can see i have a database feld DES1 have a name for a file to download and DOWNLOAD1 the file to download my probelm is IF des1 = ".." dont put the link in href

i put something like this but not work

 

if(des1==".."){

      <li><a><?php echo $row_detailis['download1']; ?></a></li>

    }else{

        <li><a href="downloads/<?php echo $row_detail['des1']; ?>"><?php echo $row_detailis['download1']; ?></a></li>

    }

 

what can be wrong??

 

TNX in advance

Link to comment
https://forums.phpfreaks.com/topic/244336-link-or-not-link/
Share on other sites

sorry was a misstype

<?php echo $row_detail['des1']; ?>"><?php echo $row_detail['download1']; ?></a></li>

 

detail is the name of the recordset, desx=the name of the download, downloadx is the file to download.. i have 4 fields for files to sownload but not allways are 4 files to choose so i want to put an if statement before each line so if the field "des1" was equal to ".." theres no file to download so the href tag must not display.... let say 

if des1= ".."

  echo ..

else

  name & link to the file for download

endif

 

 

Link to comment
https://forums.phpfreaks.com/topic/244336-link-or-not-link/#findComment-1255075
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.