For sending a link to a email (confirming subscription). i need the path to the file subscribe.php
.
On my webserver, the file subscribe.php
is in the webroot.
External access will be: http://newsletter.mydomain.com/subscribe.php
This is the link in subscribe.php
which i send to the user by email:
$mail->Body = '<a href="'.$subscribe_path.'subscribe.php?name='.urlencode(base64_encode($name)).'&email='.urlencode(base64_encode($email)).'">Confirm your email</a>';
At this moment i use this:
$subscribe_path = 'http://newsletter/mydomain.com/'
How can i grab the path more generally? i tried:
$subscribe_path = dirname(__FILE__).'/';
but that produces something like /home/vhosts/mydomain.com/subdomains/newsletter/httpdocs/