Gossamer Forum
Home : Products : DBMan : Customization :

View record problem

Quote Reply
View record problem
I have my users enter a URL, when they add a record, if they have a website for users to view. When the record is added and viewed, I do not display the URL itself but I have it linked to their website name that they provided in one of the fields. This works great but if a user wishes to not enter a URL when adding a record the website name is still hyperlinked but points to my dbman.cgi.

What I would like to do is have it hyperlink to website if URL submitted and not hyperlink website if they don't enter a URL. (Just display the webpage title with no hyperlink).

The code below is what I did to hyperlink the website name (In this case Agency). This is in sub_html_record in html.pl.
---------
<td width="84" valign="top" align="center" bgcolor="#00ADBD"><strong><small><font face="Verdana">Agency:</font></small></strong></td><td width="417" bgcolor="#EFEFEF">
<small><font face="Verdana"><A HREF="$rec{'URL'}">$rec{'Agency'}</A></font></small>
</td></tr>
----------

Thank you for the assistance.
Quote Reply
Re: View record problem In reply to
Guess I didn't need all that gobbly-goo.

Here's the condensed version:

----------

<A HREF="$rec{'URL'}">$rec{'Agency'}</A>

----------

Thanks again.
Quote Reply
Re: View record problem In reply to
This works for me.
Code:
|; #to close print qq| if open
print qq! <a href="$rec{'URL'}" >! if($rec{'URL'});
print qq|<$font> <b>$rec{'Title'}</b></Font></a>
It prints the Title as a link only if the field named URL has something in it, and no default value like "http://"



[This message has been edited by Dave T (edited December 09, 1999).]
Quote Reply
Re: View record problem In reply to
new gobbly-goo.

Code:
<td width="84" valign="top" align="center" bgcolor="#00ADBD">
<strong><small><font face="Verdana">Agency:</font></small></strong></td>
<td width="417" bgcolor="#EFEFEF"><small><font face="Verdana">
|; #### to close print qq|
print qq!<A HREF="$rec{'URL'}">! if($rec{'URL'});
print qq|$rec{'Agency'}</A></font></small>
</td></tr>

hope this works for you.
Quote Reply
Re: View record problem In reply to
Thank you Dave T - Works perfect now!! Smile