close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Linking Issue

Thread began 4/07/2011 9:08 am by hbibizadeh396670 | Last modified 4/07/2011 12:19 pm by Jason Byrnes | 1428 views | 5 replies |

hbibizadeh396670

Linking Issue

Hi

I have made a comment system for my website. Although the system works fine I have found an issue.

When a user submits a comment, they can add a url to their website.

In the posted comments, the name of the user is set up to be a link to the url field in the database.

The problem is if the user does not submit a url with their comment the link still appears and links to a blank page.

How to I make it so the name field only has a link is a link is submitted with a comment

Thanks in advance

Sign in to reply to this post

Jason ByrnesWebAssist

by using an if statement around the anchor tag to only show if the recordset contains a link.

I would need a copy of your page to give you exact code to use.

Sign in to reply to this post

hbibizadeh396670

Here

Thanks for this

Sign in to reply to this post

Jason ByrnesWebAssist

change:

php:
<a href="<?php echo $row_Posts['URL']; ?>"><?php echo $row_Posts['URL']; ?></a>




to:

php:
<?php if($row_Posts['URL'] != "") { ?>

<a href="<?php echo $row_Posts['URL']; ?>"><?php echo $row_Posts['URL']; ?></a>
<?php }  ?>
Sign in to reply to this post

hbibizadeh396670

Thanks for your help.

I would just like to ask if it would be possible for you to delete my attachment above.

If you dont mind.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

no worries, it's deleted.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...