Where and how to define variables for URLs etc

I believe you can just use site_url() + the path – so for instance:

<input type="hidden" name="cancelurl" value="<?php echo site_url('/cancel/'); ?>">

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)