Usually in my PHP apps I have a base URL setup so I can do things like this
tom/jones\">Tom
You can use the built in wordpress function site_url() which retrieves the URL for the current site.
site_url()
Take a look at site_url for more details.
EX:
Tom