I am using a PHP variable on a public web page as:
<a href="$user_website">
This variable extracts a user’s website address from a mysql database when user inserts his web address into a form in his backoffice. If the user has left the field blank, the dynamic link with the variable in it appears as”
<a href="">
which of course causes the current page to refresh when the link is clicked. I don’t want to create a default link in the mysql database, since I’m already using “http://” as the default for this field for purposes of prompting the user to enter this before “www.website.com” for proper linking where it will appear in the public web page.
How do I create a default value that will be placed inside the <a href=""> in the event the user leaves this field blank in the form provided for him?
Just check if
$user_websiteis empty: